| Extracted from Pike v7.8 release 866 at 2016-04-05.

[Top]
Sql
Sql.postgres

# Class Sql.postgres

Description

  This is an interface to the Postgres (Postgres95, pgsql) database server. This module may or may not be available 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.

Note

  This driver has been deprecated. You should use the more advanced driver Sql.pgsql to access PostgreSQL databases instead.

Note

  Also note that this module uses blocking I/O to connect to the server. It is 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; some notice and warning notifications might are dumped on stderr.

  `"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.pgsql , Sql.Sql , Postgres.postgres , Sql.postgres_result

Inherit mo

  inherit Postgres.postgres : mo

Variable version

  `string Sql.postgres.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.

Inherit pgsql

  inherit Sql.pgsql : pgsql

Description

  Maps SQL-urls for `postgres://[user[:password]@][hostname][:port][/database]` onto `pgsql://[user[:password]@][hostname][:port][/database]`

  The reason this happens, is because Pike was compiled without libpq support, therefore Pike falls back to the faster, smaller memory footprint, more advanced and native PostgreSQL driver called Sql.pgsql .

See also

  Sql.pgsql , Sql.Sql