Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
labs:postgresql [2009/07/06 20:58] – admin | labs:postgresql [2016/06/27 16:06] – [Creating Sequences] admin | ||
---|---|---|---|
Line 13: | Line 13: | ||
You can use * to mean all columns in the table. | You can use * to mean all columns in the table. | ||
+ | |||
+ | === Explanation of Various Joins === | ||
+ | |||
+ | The picture below comes from [[http:// | ||
+ | |||
+ | {{http:// | ||
+ | |||
==== Insert Statements ==== | ==== Insert Statements ==== | ||
Line 53: | Line 60: | ||
===== Creating Tables ===== | ===== Creating Tables ===== | ||
- | ==== Creating Sequences ==== | + | ===== Creating Sequences |
| | ||
- | ==== Viewing Table Information ==== | + | ===== Viewing Table Information |
You may want to look at a table' | You may want to look at a table' | ||
Line 85: | Line 92: | ||
SELECT * FROM pg_roles; | SELECT * FROM pg_roles; | ||
+ | ==== Creating User ==== | ||
+ | |||
+ | CREATE USER username [WITH PASSWORD '' | ||
+ | |||
+ | Or | ||
+ | |||
+ | createuser | ||
+ | |||
+ | ==== Adding user to groups ==== | ||
+ | |||
+ | ALTER GROUP groupname ADD user username [, ... ] | ||
==== Granting Permissions ==== | ==== Granting Permissions ==== | ||
Line 105: | Line 123: | ||
ALTER TABLE table_name ADD COLUMN col_name type ... | ALTER TABLE table_name ADD COLUMN col_name type ... | ||
+ | |||
+ | === Change Column === | ||
+ | |||
+ | ALTER TABLE quizzes ALTER COLUMN name TYPE varchar(30); | ||
==== Dump Data Base ==== | ==== Dump Data Base ==== | ||
pg_dump < | pg_dump < | ||
+ | |||
+ | ==== Connecting to Another Database ('' | ||
+ | |||
+ | \c dbname |