For PostgreSQL

pgsql://user:password@host[:port]|[local]/database?
   charset=value& [value is pgsql charset name]
   ClientCharset=charset&
   autocommit=1& [3.3.0]
   datestyle=value& [valid values are ISO,SQL,Postgres,European,US,German. ISO by default]
   
standard_conforming_strings=0
[3.4.3]

Optional parameters:
port-port number.

One can also specify:
user:password@host:port/database,

or:
user:password@local/database

In latter case, Parser will connect to server established at local computer.

charset-right after connection executes "SET CLIENT_ENCODING=value";
ClientCharset-specifies the charset, in which Parser must communicate with SQL server. Conversion will be done by driver;
autocommit-by default Parser executes COMMIT after each sucessfull query. If option autocommit=0 was specified this behaviour will changed and all queries inside one connect operator will be executed in single transaction;
datestyle-if this parameter is specified, right after connection the driver executes "SET DATESTYLE=value"
standard_conforming_strings
-if this parameter is set to 1, the driver will not escape '\' character to conform SQL standards.


Example
Assume, data in your database is stored in windows-1257, connect string should look like this:
pgsql://user:password@host/database?ClientCharset=windows-1257


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 23.10.2013