20 lines
464 B
Plaintext
20 lines
464 B
Plaintext
|
%title Postgres Commands
|
||
|
:dev:
|
||
|
%date 20200109-1320
|
||
|
|
||
|
= Quick Tips =
|
||
|
`\l` List all Databases
|
||
|
`\c <database>` Connect to a database
|
||
|
`\dt` List all tables (once connected to a db)
|
||
|
`DELETE FROM <table> WHERE <condition>` delete rows from a table
|
||
|
Strings must be wrapped in ''
|
||
|
create a table:
|
||
|
`CREATE TABLE <table_name>(`
|
||
|
` column1 datatype,`
|
||
|
` column2 datatype,`
|
||
|
` column3 datatype,`
|
||
|
` .....`
|
||
|
` columnN datatype,`
|
||
|
` PRIMARY KEY( one or more columns )`
|
||
|
`);`
|