=Useful PostgreSQL Script=
==Loading/Unloading Data==
Always load/unload data using the PostgreSQL specific copy function below. Always load tab-delimited data that is UTF-8 encoded, with PC or UNIX line endings, and that has a header row. NEVER DEVIATE FROM THIS.
Unload (copy to txt file) using:
\COPY tablename TO 'filename.txt' WITH DELIMITER AS E'\t' HEADER NULL AS '' CSV
==Creating Tables==
DROP TABLE tablename;
CREATE TABLE tablename (
field1 varchar(100),
field2 int,
field3 date,
field4 real
);