PQsetdbLogin Function

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

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

Example

   type(c_ptr) :: conn

   conn = PQsetdbLogin("localhost", "5432", "", "", "postgres","postgres", "")

   ! Error handling
   if (PQstatus(conn) /= CONNECTION_OK) then
      print *, PQerrorMessage(conn)
   end if

cf. PostgreSQL Documentation

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)


Contents