Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgresql pg_dump

pg_dump -U user -d db_name -h 127.0.0.1 > dump.sql 
Comment

postgres make sql dump

pg_dump -U username dbname > dbexport.pgsql
Comment

postgres dump

----------- DOCKER ----------
## Dump
docker exec -i pg_container_name /bin/bash -c "PGPASSWORD=pg_password psql --username pg_username database_name" > /desired/path/on/your/machine/dump.sql

## Restore
docker exec -i pg_container_name /bin/bash -c "PGPASSWORD=pg_password psql --username pg_username database_name" < /path/on/your/machine/dump.sql
Comment

pg_dump

pg_dump -U postgres -h localhost --format=c --file=name_backup.sqlc database_name
Comment

PREVIOUS NEXT
Code Example
Sql :: sql sum if 
Sql :: mysql show foreign keys 
Sql :: invalid reference to FROM-clause entry for table "unidades 
Sql :: mysql get count of rows 
Sql :: dynamics 365 x++ aggregate querybuilddatasource 
Sql :: dao function to check if database contains value 
Sql :: how to copy data of a table from another database to table of anaother database 
Sql :: monthname sql 
Sql :: postgresql random number 
Sql :: drop temp table sql 
Sql :: mysql date format unix timestamp 
Sql :: copy sql table 
Sql :: oracle session date format 
Sql :: apex select list ORA-20999 
Sql :: mysql month name extract 
Sql :: sql server roles and users 
Sql :: mysql show data from table 
Sql :: mssql cursor 
Sql :: how to delete a column in sql 
Sql :: laravel paginate raw sql 
Sql :: oracle stop 
Sql :: replace null with 0 in sql 
Sql :: sqlite version check 
Sql :: postgresql where datetrunc month and year equal 
Sql :: mysql change primary key 
Sql :: show tables sql 
Sql :: mysql public key retrieval is not allowed 
Sql :: sql server cannot create database diagram 
Sql :: create table like sql 
Sql :: sql update all rows 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =