What does "pgoptions" should contain in C - function PQsetdb

Поиск
Список
Период
Сортировка
От Monika Farkasova
Тема What does "pgoptions" should contain in C - function PQsetdb
Дата
Msg-id Pine.LNX.3.96.981209190040.30967B-100000@alfa.intrak.tuke.sk
обсуждение исходный текст
Список pgsql-admin
Hello,

I work with postgresql-6.3.2-10 on Linux Redhat 5.2

In simple example of database connection in C-language (in
documentation) you set the pgoptions=NULL. It works.

How cat I say to function
PQsetdb(char * pghost, char * pgport, char *pgoptions, char * pgtty,
     char * dbName);
that I want to connect database  as user=someone and with password=
something.

example:

char *pghost, *pgport, *pgoptions, *pgtty, *dbName;

pghost="hron.fei.tuke.sk";
pgport="5432";
pgoptions="??????????";
pgtty=NULL;
dbName="student"

PQsetdb(pghost,pgport,pgoptions,pgtty,dbName);


What does the "pgoptions" contain and what is the syntax instead of NULL.

In dba.conf I have set the password passwordfile.

I tryed to use the syntax of  PHP function for postgres:
    pg_Connect("dbname=db user=someone password=something");

in C function as:
         PQsetdb("dbname=db user=someone password=something");

but it does not work.

I can not use the PQOPTION in psql, too.

    Monika Farkasova




В списке pgsql-admin по дате отправления:

Предыдущее
От: Frederic Nourry
Дата:
Сообщение: Database Security
Следующее
От: LAU ENG HUAT
Дата:
Сообщение: When will I receive my update CD for Postgre 6.4