current position:Home>PostgreSQL database operation

PostgreSQL database operation

2022-01-27 02:28:40 Danshui Yu

Database files

Query database location :select oid, datname from pg_database
 Insert picture description here

Query table location

Query table location select pg_relation_filepath(‘sqlth_drv’);
 Insert picture description here

Database backup

.\pg_dump.exe -h 127.0.0.1 -p 5433 -U postgres -c -f d:\postgres_Taohy postgres_Taohy
 Insert picture description here

Database restore

New database BakTest .\createdb -h localhost -p 5433 -U postgres BakTest
Restore .\psql -U postgres -p 5433 -f D:/postgres_Taohy BakTest
 Insert picture description here
 Insert picture description here

copyright notice
author[Danshui Yu],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270228384825.html

Random recommended