After connecting to a server hosted on EDB Ark with the psql client, you can invoke SQL commands or use meta-commands to:By default, an EDB Ark cluster is only open to connections via port 9999 on the master node. Port 9999 is a good choice if you are connecting for the purpose of querying the database, but if you are modifying database objects, or performing administrative functions, you should connect directly to the server's listener port.Some administrative functions, if executed over port 9999, may be directed to the incorrect node of a multi-node cluster where they may not have the intended effect, or may return an invalid value.The listener port number is displayed in the DBPORT column of the Details panel of the Clusters tab.Before connecting to the server's listener port, an Ark administrator must modify the security group to allow connections from the host of your client application.After installing Advanced Server or PostgreSQL on a local workstation, you can use psql to perform administrative tasks on an EDB Ark cluster.To open the psql client on an Advanced Server workstation, navigate through the Applications (or Start) menu to the Postgres Plus Advanced Server menu; then, open the Run SQL Command Line menu, and select EDB-PSQL.To open a psql client on a PostgreSQL workstation, navigate through the Applications (or Start) menu to the PostgreSQL menu, and select SQL Shell (psql).
• When prompted for a Server, enter the IP address or DNS name of the EDB Ark server. The IP address is displayed in the DNSNAME column on the Details panel of the Clusters tab of the Ark console.
• When prompted for a Database, enter the name of the database to which you wish to connect. By default, an Advanced Server cluster is created with a database named edb; a PostgreSQL cluster is created with a database named postgres.
• When prompted for a Port, enter the port on which the server is listening. For database queries, you can use port 9999; if you are modifying database objects or performing administrative functions, you should use the server's listener port (5444 for an Advanced Server cluster, 5432 for a PostgreSQL cluster).
• When prompted for a Username, enter the role you wish to use when connecting to the server. The name of the database superuser is specified in the Master User field when defining an EDB Ark server cluster. By default, the Advanced Server database superuser is enterprisedb. The default superuser of a PostgreSQL database is postgres.
• When prompted for a Password, enter the password associated with that role. The database superuser's password is specified in the Master Password field when defining an EDB Ark server cluster.After connecting, the prompt will display the name of the database to which you are connected (as shown in Figure 13.13).To use a copy of the psql client that resides on the EDB Ark host, first connect to the cluster using ssh:ssh -i/path/ssh_key root@host_nameAfter connecting to the host, assume the identity of the database superuser (or a user with sufficient privileges to invoke the client). On an Advanced Server host, use the command:Include the -d option to specify the name of the database to which you wish to connect. The session opens as shown in Figure 13.14.To exit the psql client, enter \q.For information about using psql and the psql meta-commands, please see the Postgres documentation at: