[Top]
Postgres
Postgres.postgres
|
Class Postgres.postgres
- Description
-
This is an interface to the Postgres (Postgres95, pgsql) database server.
This module may or may not be availible on your Pike, depending
whether the appropriate include and library files
could be found at compile-time. Note that you do not
need to have a Postgres server running on your host to use this module:
you can connect to the database over a TCP/IP socket.
Please notice that unless you wish to specifically connect to a Postgres
server, you'd better use the Sql.Sql , which is a server-independent
sql-server-class. The interfaces to all existing sql-classes
are consistent. Using Sql.Sql ensures that your Pike
applications will run with any supported SQL server without changing
a single line of code, at least for most common (and simple) operations.
The program Postgres.postgres provides the raw interface
to the database. Many functions are not availible
for this program. Therefore, its use is DEPRECATED.
It is included in this documentation only for completeness' sake.
Use Sql.postgres instead, or even better Sql.Sql
- Note
-
There is no testsuite for this module, since to test anything would
require a working Postgres server. You can try to use the included scripts
in the "pike/src/modules/Postgres/extras" directory but you'll probably
have to patch them to reflect your site's settings.
Also note that this module uses blocking I/O I/O to connect to the server.
Postgres is quite slow, and so you might want to consider this
particular aspect. It is (at least should be) thread-safe, and so it can be used
in a multithread environment.
The behavior of the Postgres C API also depends on certain environment variables
defined in the environment of the pike interpreter.
"PGHOST" | Sets the name of the default host to connect to. It defaults
to "localhost"
|
"PGOPTIONS" | Sets some extra flags for the frontend-backend connection.
DO NOT SET unless you're sure of what you're doing.
|
"PGPORT" | Sets the default port to connect to, otherwise it will use
compile-time defaults (that is: the time you compiled the postgres
library, not the Pike driver).
|
"PGTTY" | Sets the file to be used for Postgres frontend debugging.
Do not use, unless you're sure of what you're doing.
|
"PGDATABASE" | Sets the default database to connect to.
|
"PGREALM" | Sets the default realm for Kerberos authentication. I never used
this, so I can't help you.
|
|
Refer to the Postgres documentation for further details.
- See also
-
Sql.Sql , Sql.postgres , Sql.postgres_result
- Variable
version
-
string version
- Description
-
Should you need to report a bug to the author, please submit along with
the report the driver version number, as returned by this call.
|