fe_connect_m Module


Contents


Functions

public function PQconnectdb(conninfo) result(conn)

Connect to the database server with the provided connection string conninfo.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: conninfo

PostgreSQL connection string

Return Value type(c_ptr)

public function PQconnectdbParams(keywords, values, expand_dbname) result(conn)

Connect to the database server with connection infomation provided as pairs of keywords and values arrays.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: keywords(:)

Keywords, such as host, hostaddr, dbname, user, password, etc.

character(len=*), intent(in) :: values(:)

The array of each value corresponding to that keyword.

integer :: expand_dbname

Return Value type(c_ptr)

public function PQsetdbLogin(host, port, options, tty, dbName, login, pwd) result(conn)

Connect to the database server with connection infomation provided as each argument

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: host

Hostname

character(len=*), intent(in) :: port

Port number

character(len=*), intent(in) :: options

Options

character(len=*), intent(in) :: tty

Empty string

character(len=*), intent(in) :: dbName

The name of the database

character(len=*), intent(in) :: login

The user name at this login

character(len=*), intent(in) :: pwd

The password of the user

Return Value type(c_ptr)

public function PQconnectStartParams(keywords, values, expand_dbname) result(conn)

Connect to the database server in a nonblocking manner.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: keywords(:)
character(len=*), intent(in) :: values(:)
integer :: expand_dbname

Return Value type(c_ptr)

public function PQconnectStart(conninfo) result(conn)

Connect to the database server in a nonblocking manner.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: conninfo

Return Value type(c_ptr)

public function PQconnectPoll(conn)

Connect to the database server in a nonblocking manner.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr) :: conn

Return Value integer(kind=int32)

public function PQresetStart(conn)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer(kind=int32)

public function PQresetPoll(conn)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer(kind=int32)

public function PQpingParams(keywords, values, expand_dbname) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: keywords(:)
character(len=*), intent(in) :: values(:)
integer, intent(in) :: expand_dbname

Return Value integer(kind=c_int)

public function PQping(conninfo) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: conninfo

Return Value integer(kind=int32)

public function PQdb(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQuser(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQpass(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQhost(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQhostaddr(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQport(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQoptions(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQstatus(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer(kind=int32)

public function PQtransactionStatus(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer(kind=c_int)

public function PQparameterStatus(conn, paramName)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn
character(len=*), intent(in) :: paramName

Return Value character(len=:), pointer

public function PQprotocolVersion(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer

public function PQserverVersion(conn) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer

public function PQerrorMessage(conn) result(PQerrormessage)

Returns the error message most recently generated by an operation on the connection.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(kind=c_char, len=:), pointer

public function PQsocket(conn)

Obtain the file descriptor number of the connection socket to the server.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer(kind=c_int)

public function PQbackendPID(conn)

Returns the process ID (PID) of the backend process handling this connection.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value integer(kind=c_int)

public function PQconnectionNeedsPassword(conn)

Retuens true if the connection authentication method required a password, but none was available. Returns false if not.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value logical

public function PQconnectionUsedPassword(conn)

Returns true if the connection authentication method used a password. Returns false if not.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value logical

public function PQsslInUse(conn)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value logical

public function PQgetCancel(conn)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value type(c_ptr)

public function PQcancel(cancel, errbuf, errbufsize)

Requests that the server abandon processing of the current command.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: cancel
character(len=*), intent(inout) :: errbuf
integer(kind=int32), intent(in) :: errbufsize

Return Value integer(kind=int32)

public function PQclientEncoding(conn) result(res)

Returns the client encoding.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn

Return Value character(len=:), pointer

public function PQsetClientEncoding(conn, encoding) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn
character(len=*), intent(in) :: encoding

Return Value integer(kind=int32)

public function PQsetErrorVerbosity(conn, verbosity) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn
integer(kind=int32), intent(in) :: verbosity

Return Value integer(kind=int32)

public function PQsetErrorContextVisibility(conn, show_context) result(res)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn
integer(kind=int32), intent(in) :: show_context

Return Value integer(kind=int32)


Subroutines

public subroutine PQconndefaults(options)

Return the default connection options.

Read more…

Arguments

Type IntentOptional Attributes Name
type(PQconninfoOption), intent(out), dimension(:), allocatable, target :: options

public subroutine PQconninfo(conn, options)

Returns the connection options used by a live connection.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn
type(PQconninfoOption), intent(out), dimension(:), allocatable, target :: options

public subroutine PQconninfoParse(conninfo, options, errmsg, errflag)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: conninfo
type(PQconninfoOption), intent(out), dimension(:), allocatable, target :: options
character(len=*), intent(out) :: errmsg
logical :: errflag

public subroutine PQfinish(conn)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(inout) :: conn

public subroutine PQreset(conn)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(inout) :: conn

public subroutine PQsslAttribute(conn, attribute_name, resultstr)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn
character(len=*), intent(in) :: attribute_name
character(len=:), allocatable :: resultstr

public subroutine PQsslAttributeNames(conn, strings, len)

Subroutine for retrieving SSL attribute names from a PostgreSQL database connection and populating an array.

Read more…

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: conn
character(len=len), allocatable :: strings(:)
integer(kind=int32), intent(in) :: len

public subroutine PQfreeCancel(cancel)

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: cancel