postgres:postgresql
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
postgres:postgresql [2009/04/02 16:56] – created deva | postgres:postgresql [2010/06/01 11:02] – deva | ||
---|---|---|---|
Line 1: | Line 1: | ||
======PostGreSQL====== | ======PostGreSQL====== | ||
+ | =====Open sql cli interface====== | ||
+ | < | ||
+ | psql -U [username] -W [database] | ||
+ | </ | ||
+ | |||
=====Creating/ | =====Creating/ | ||
< | < | ||
Line 9: | Line 14: | ||
< | < | ||
createdb -O [owner] -h localhost [dbname] | createdb -O [owner] -h localhost [dbname] | ||
+ | </ | ||
+ | |||
+ | =====Import/ | ||
+ | < | ||
+ | psql -U [username] -W [dbname] < dump.sql | ||
+ | pg_dump -U [username] -h localhost [-t [table]] [dbname] > dump.sql | ||
+ | </ | ||
+ | |||
+ | =====Cut prefix from table===== | ||
+ | < | ||
+ | ALTER TABLE data ALTER COLUMN filename TYPE character varying(255) USING substring(filename from 20); | ||
</ | </ |
postgres/postgresql.txt · Last modified: 2011/01/25 07:44 by deva