One connects to a database using the following statement:
EXEC SQL CONNECT TO target [AS connection-name] [USER user-name];
The target can be specified in the following ways:
dbname[@hostname][:port]
tcp:postgresql://hostname[:port][/dbname][?options]
unix:postgresql://hostname[:port][/dbname][?options]
character variable
character string
DEFAULT
There are also different ways to specify the user name:
userid
userid/password
userid IDENTIFIED BY password
userid USING password
The userid and password may be a constant text, a character variable, or a character string.
The connection-name is used to handle multiple connections in one program. It can be omitted if a program uses only one connection.
No comments could be found for this page.
Please use this form to add your own comments regarding your experience with particular features of PostgreSQL, clarifications of the documentation, or hints for other users. Please note, this is not a support forum, and your IP address will be logged. If you have a question or need help, please see the faq, try a mailing list, or join us on IRC. Note that submissions containing URLs or other keywords commonly found in 'spam' comments may be silently discarded. Please contact the webmaster if you think this is happening to you in error.
In order to submit a comment, you must have a community account.
* denotes required field