Popular `postgresql` terminal commands
Create a copy of a PostgreSQL database
Creates a new Postgres database, using an existing database as a template for which to build the database.
Authored by: zbyszek
Execute a .sql file against a PostgreSQL database
Runs .sql file against a Postgres database, while also handling authentication.
Authored by: pmverma
Import SQL dump into a PostgreSQL database
Imports a SQL dump into an existing database. Note the database must already be created for this to work.
Authored by: dazz
Migrate from MySQL Database to PostgresSQL Database
Loads data from the MySQL database, transforms it to PostgreSQL compatible format and uploads it to the PostgreSQL database. Note - it requires pgloader to be installed and both PostgreSQL and MySQL hosts are accessible from the machine running this script.
Authored by: Dipak Parmar
Store result of a PostgreSQL query as a CSV file
Executes a query against a Postgres database and writes the output to a new file
Authored by: sorin