pq_connectdbΒΆ
pq_connectdb makes a new connection to the database server.
- db = pq_connectdb(ssConninfo)
Return Value
db is the connection pointer. pq_finish closes the connection to the server. If pq_finish is not invoked the garbage collector will close the connection. (see gc). .. us.params
Parameters
- ssConninfo
ssConninfo is a string with whitespace separated Keyword/Value pairs. The most importend keys are:
host
Name of the host to connect to, e. g. localhost.
hostaddr
IP address of host.
port
TCP/IP Port Nummer.
dbname
The database name.
user
PostgreSQL user name to connect as.
password
Password.
Example
def test_pq_connectdb()
{
loadlib("rs_pq.dll")
ssConnect = "host=p3200server port=5432 dbname=postgres user=postgres password=postgres";
conn = pq_connectdb(ssConnect);
stat = pq_status(conn);
if (stat != PQ_CONNECTION_OK) {
MessageBoxError(pq_error_message(conn));
error();
}
return conn;
}
Comment
More information can be found at http://www.postgresql.org.
History
Version |
Description |
---|---|
5.5.0 |
New |
See also
id-657453