database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 2320 게시물 읽기
No. 2320
아~ postgresql는 공짜인데.. 왜.. mysql보다 인기가 없는 것일까?
작성자
이태웅
작성일
2001-02-19 17:01
조회수
4,585

//;

바로 한글로 설명해주는 문서의 부재가 아닐까 싶네요.

주효식님과 정재익님등의 노고에도 불구.....

//;

문서들의 한글화가 postgresql이 대중화가 되는 지름길이 아닐까 싶네요.

이런 의미에서 오늘 1시간동안 허접질한 c언어 함수에 대한 설명.. //;

먼저 DB에 접근하는 함수 설명

PGconn *PQconnectdb(const char *conninfo)

데이터베이스에 새로운 연결을 만든다.

conninfo에는 host,hostaddr,port,dbname,user,password,options,tty들을 포함하고 있다.

각 항목은 "form 키워드=값"으로 설정할수 있다.

 

PGconn *PQsetdbLogin(const char *pghost,

const char *pgport,

const char *pgoptions,

const char *pgtty,

const char *dbName,

const char *login,

const char *pwd)

데이터베이스에 새로운 연결을 만든다.

PQconnectdb랑 같은 일을 한다.

 

PGconn *PQsetdb(char *pghost,

char *pgport,

char *pgoptions,

char *pgtty,

char *dbName)

데이터베이스에 새로운 연결을 만든다.

PQsetdfLogin이랑 같은 일을 한다.(macro)

 

PostgresPollingStatusType *PQconnectPoll(PQconn *conn)

 

void PQfinish(PGconn *conn)

데이터베이스와 접속을 끊는다.

 

void PQreset(PGconn *conn)

데이터베이스와의 접속을 재설정한다.

 

char *PQdb(const PGconn *conn)

conn에 연결되어있는 db의 이름을 돌려준다.

 

char *PQuser(const PGconn *conn)

conn에 연결되어있는 사용자의 이름을 돌려준다.

 

char *PQpass(const PGconn *conn)

password를 가르쳐준다.

 

char *PQhost(const PGconn *conn)

host명을 가르쳐준다.

 

char *PQport(const PGconn *conn)

port를 가르쳐준다.

 

char *PQtty(const PGconn *conn)

연결된 tty를 갈쳐준다.

 

char *PQoptions(const PGconn *conn)

옵션을 갈쳐준당.

 

ConnStatusType PQstatus(const PGconn *conn)

접속상황을 갈쳐준다.

 

다음. 쿼리수행관련 함수

PGresult *PQexec(PGconn *conn,

const char *query);

쿼리를 실행하고 결과를 기다린다.(결과나올때까지)

 

int PQsendQuery(PGconn *conn, const char *query);

쿼리를 날리고 결과를 안기다린다. //;

성공적으로 수행했다면 PQgetRusult를 실행해서 쿼리결과를 알아온다.

PQgetRusult이 NULL을 리턴하지 않는 한 같은 명령을 두번 날리지마라.

 

PGresult *PQgetResult(PGconn *conn)

PQsendQuery에 의한 결과를 기다리고 리턴한다.

쿼리가 완료되었고 결과가 더 없으면 NULL을 리턴한다.

 

int PQisBusy(PGconn *conn)

쿼리가 실행중인지 확인한다. 1이면 실행중 0이면 PQgetResult를 쓸수 있다.

 

ExecStatusType PQresultStatus(const PGresult *res)

쿼리의 마지막 상황을 알려준다.

PGRES_EMPTY_QUERY

PGRES_COMMAND_OK

PGRES_TUPLES_OK

PGRES_COPY_OUT

PGRES_COPY_IN

PGRES_BAD_RESPONSE

PGRES_NONFATAL_ERROR

PGRES_FATAL_ERROR

 

char *PQresStatus(ExecStatusType status)

PQresultStatus에서 나온 에러코드를 문자열로 바꿔준다. /1이면 없는거다.

 

char *PQresultErrorMessage(const PGresult *res)

쿼리에서 나온 에러코드를 문자열로 바꿔준다.

 

int PQfnumber(const PGresult *res, const char *field_name)

field_name에 해당되는 필드번호를 리턴한다.

 

char *PQfname(const PGresult *res, int field_index)

field_index 번호에 해당되는 필드명을 리턴한다.

 

int PQbinaryTuples(const PGresult *res)

보기가 2진코드면 1을 리턴하고 2진코드가 아니면 0을 리턴한다.

 

int PQnfields(const PGresult *res)

쿼리결과의 보기의 필드숫자를 알려준다.

 

int PQntuples(const PGresult *res)

쿼리결과의 보기(tuples)의 갯수를 정수로 알려준다.

 

Oid PQftype(const PGresult *res, int field_num)

field_num에 있는 필드의 type을 리턴한다. oid는 src/include/catalog/pg_type.h에

명시되어있다.(데이터베이스마다 틀리다.)

 

int PQfsize(const PGresult *res, int field_index)

field_index에 있는 필드의 사이즈를 byte단위로 리턴한다.

 

int PQfmod(const PGresult *res, int field_index)

field_index에 있는 //뭐라고?//

 

char* PQgetvalue(const PGresult *res, int tup_num, int field_num)

PGresult의 보기값의 단일필드의 속성값을 리턴한다.(문자열로?)

 

int PQgetlength(const PGresult *res, int tup_num, int field_num)

필드의 길이를 byte단위로 리턴한다.

 

int PQgetisnull(const PGresult *res, int tup_num, int field_num)

NULL인지 확인한다. NULL이면 1을 리턴한다.

 

char * PQcmdStatus(const PGresult *res)

PGresult에의해 만들어진 SQL명령의 상황을 리턴한다.(문자열로)

 

char * PQcmdTuples(const PGresult *res)

SQL명령에 의해 적용된 결과의 줄을 리턴한다(?)

 

Oid PQoidValue(const PGresult *res)

삽입된 보기의 오브젝트ID를 리턴한다.

 

char * PQoidStatus(const PGresult *res)

삽입된 보기의 오브젝트ID와 문자열을 리턴한다.

 

void PQclear(PQresult *res)

PGresult에 의해 만들어진 저장공간을 해제한다.

 

PGresult* PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status)

뭐냐 이건..

 

겔겔.. 사전 찾아봐야겠다. 내가 아는 영단어의 수준이 겨우

이런 것이었단 말인가?

수고욥~

[Top]
No.
제목
작성자
작성일
조회
2325oid 란 data type?
이주형
2001-02-20
4460
2326┕>Re: oid 란 data type?
신현호
2001-02-20 04:49:05
3946
2324IPV6 인가?
신현호
2001-02-20
3190
2327┕>Re: IPV6 인가?
정재익
2001-02-20 09:59:53
3769
2323Sequence 의 최대 값은 얼마일까요?
정재익
2001-02-20
3514
2320아~ postgresql는 공짜인데.. 왜.. mysql보다 인기가 없는 것일까?
이태웅
2001-02-19
4585
2321┕>Re: 아~ postgresql는 공짜인데.. 왜.. mysql보다 인기가 없는 것일까?
정재익
2001-02-19 17:08:35
3891
2322 ┕>Re: Re: 아~ postgresql는 공짜인데.. 왜.. mysql보다 인기가 없는 것일까?
이태웅
2001-02-19 17:18:56
3655
2317저기.. postgresql과 C언어가 연동되는 게시판 소스같은 것은 없나요?
이태웅
2001-02-19
4199
2319┕>Re: 저기.. postgresql과 C언어가 연동되는 게시판 소스같은 것은 없나요?
정재익
2001-02-19 16:12:03
4378
2316백업시 에러가 납니다.
조석연
2001-02-19
3313
2318┕>Re: 백업시 에러가 납니다.
정재익
2001-02-19 15:43:19
3636
2314역시 문서가 중요하군요...
배찬일
2001-02-19
3176
2315┕>Re: 역시 문서가 중요하군요...
정재익
2001-02-19 11:12:36
3537
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.018초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다