Changes

Jump to navigation Jump to search
163 bytes added ,  14:01, 15 May 2019
=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
);
241

edits

Navigation menu