PGSQL_Connect

4D - Documentation   Français   English   German   4D For PostgreSQL, Command Theme List   4D For PostgreSQL, Command Alphabetical List   Back   Previous   Next

version 2004


PGSQL_Connect (host ; port; options; tty; database; user; password) Longint

ParameterTypeDescription
host StringHost address
portStringPort number
optionsStringConnection options
ttyStringFile or tty to get debug output from back end
databaseStringDatabase name
userStringUser name
passwordStringPassword
Function resultLongintConnection ID

Description

The PGSQL_Connect command connects to the specified database and returns a connection ID (Longint) that is used during the connection session.

host is a String that corresponds to the PostgreSQL server's address (IP or DNS).

port is a String that corresponds to the port used by the PostgreSQL server to listen at (default is 5432).

options is a String that corresponds to the PostgreSQL connection options (please see the PostgreSQL documentation).

tty is a String that corresponds to the tty optional output options (please see the PostgreSQL documentation).

database is a String that corresponds to the PostgreSQL database name you want to connect to.

user is a String that corresponds to the PostgreSQL user.

password is a String that corresponds to the password used by the PostgreSQL user.

Example

      `Init
   $Host:="192.168.0.1"
   $Tty:=" "
   $Options:=" "
   $Database:="Manager"
   $User:="Doug"
   $Password:="r74d96gRfx"
      `Connection
   PGConnID:=PGSQL_Connect($Host;$Port;$Options;$Tty;$Database;$User;$Password)
   If(PGConnID#0)
         `Successful connection
      ...
   Else
         `PGConnID is null, we have a connection error
      ...
   End if

4D - Documentation   Français   English   German   4D For PostgreSQL, Command Theme List   4D For PostgreSQL, Command Alphabetical List   Back   Previous   Next