PostgreSQL – List Column Names


to get list of columns on certain table use this command:

select column_name, data_type  from INFORMATION_SCHEMA.COLUMNS where table_name = ‘table’;

Advertisements

PostgreSQL – Backup Table Only


for version >= 8.4.0:
pg_dump –column-inserts –data-only –table=<table> <database>

for version < 8.4.0:
pg_dump -D -t <table> <database>

 

source:

http://stackoverflow.com/questions/2857989/using-pg-dump-to-only-get-insert-statements-from-one-table-within-database