
How do I specify a password to 'psql' non-interactively?
Sep 15, 2021 · 770 I am trying to automate database creation process with a shell script and one thing I've hit a road block with passing a password to psql. Here is a bit of code from the shell script: ...
PostgreSQL: Remotely connecting to Postgres instance using psql …
I want to remotely connect to a Postgres instance. I know we can do this using the psql command passing the hostname I tried the following: psql -U postgres -p 5432 -h hostname I modified the /etc/
How to use “psql” to connect to PostgreSQL in SSL mode?
I am trying to configure SSL certificate for PostgreSQL server. I have created a certificate file (server.crt) and key (server.key) in data directory and update the parameter SSL to "on" to
Run PostgreSQL queries from the command line - Stack Overflow
Oct 30, 2013 · If you're new to postgresql and unfamiliar with using the command line tool psql then there is some confusing behaviour you should be aware of when you've entered an interactive …
sql - What is the difference between "psql -c" and "psql -f" when ...
Jan 16, 2019 · What is the difference between "psql -c" and "psql -f" when executing multiple queries? Asked 7 years, 3 months ago Modified 7 years, 3 months ago Viewed 6k times
postgreSQL - psql \\i : how to execute script in a given path
I'm new to postgreSQL and I have a simple question: I'm trying to create a simple script that creates a DB so I can later call it like this: psql -f createDB.sql I want the script to call other s...
postgresql - How to switch databases in psql? - Stack Overflow
Oct 16, 2010 · 3 You can list all the databases in the psql terminal using \l or \list. To select a database you can use \c dbname or \connect dbname. [INFO] You cannot use this commands in pgAdmin.
How do you use script variables in psql? - Stack Overflow
This only works in psql but doesn't work with -c / --command; you have to send the command via stdin or via -f. It won't work in (say) PgAdmin-III too. This substitution happens during input processing in …
psql: error: connection to server at "localhost" (::1), port 5432 ...
Nov 17, 2022 · I had the same issue with psql shell on Windows. I solved it by running the pg_env.bat file in C:\Program Files\PostgreSQL\16rc1\ before running psql.This file sets the environment …
How to list databases in terminal in PostgresSQL?
I'm experienced with MySQL, but I've just started to work with Postgres - from the terminal, how can I see the list of existing Postgres databases using the psql command? I checked the documentatio...