How to list all foreign servers in a Postgres database from psql command line? Servers can be created by create server
Summary. Use \l or \l+ in psql to show all databases in the current PostgreSQL server.
A Foreign Server represents a JNDI provider that is outside WebLogic server. It contains information that allows a local WebLogic Server instance to reach a remote JNDI provider, thereby allowing for a number of foreign connection factory and destination objects to be defined on one JNDI directory.
Step 1: Log in to the server using the SQL Shell (psql) app. Step 2: Run the following query: SELECT datname FROM pg_database; psql runs the query against the server and displays a list of existing databases in the output.
You can query the system catalog pg_foreign_server, e.g.:
select srvname as name, srvowner::regrole as owner, fdwname as wrapper, srvoptions as options from pg_foreign_server join pg_foreign_data_wrapper w on w.oid = srvfdw; name | owner | wrapper | options ----------------+----------+--------------+---------------------------------------- csv_server | postgres | file_fdw | foreign_server | postgres | postgres_fdw | {host=localhost,port=5432,dbname=test} (2 rows)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With