Postgresql Code Samples


How to copy a table from one database to another database in PostgreSQL?
Reshma | 4 years, 5 months
pg_dump -U user1 db_name_old_db | psql -U user2 db_name_target_db
It should be trigger in command prompt not from SQL tool
database postgresql copy table
Connect to PostgreSQL in c# applications using Npgsql
harika | 4 years, 9 months
using System.Text;
using System.Threading.Tasks;
using IronPython.Hosting;
By default PostgreSql installed on 5432 port. If you have already configured the port while installi
c# csharp postgresql
How to connect to PostgreSQL database and display list of tables in python
kishore_kumar | 5 years, 1 month
import psycopg2

conn = psycopg2.connect(host="localhost", database="mydb", user="kishore", passwo
python psycopg2 postgresql
Adding a new auto increment column to a table in postgres
kishore_kumar | 4 years, 7 months
-- New versions of postgres
-- adding as primary key

sql postgres postgresql
How to dump a database in postgresql
Reshma | 4 years
sudo -i -u postgres

dump postgresql sql
Move a table to other schema in Postgres
kishore_kumar | 5 years, 1 month
ALTER TABLE table_name SET SCHEMA new_schema
sql postgresql
How to stop the PostgreSQL manually?
Reshma | 4 years, 8 months
show data_directory;   //To see the directory where the Postgresql data will be stored.

pg_ctl -D
manual stop postgresql mysql
How to delete SEQUENCE in postgresql
Reshma | 4 years, 6 months
drop sequence sequence_name;
sequence postgresql mysql