Created
March 11, 2016 14:32
-
-
Save ktakashi/031d74c690c328f3df9a to your computer and use it in GitHub Desktop.
PostgreSQL: select ${table} from ${table}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postit=> \d users | |
Table "public.users" | |
Column | Type | Modifiers | |
-------------+-----------------------------+------------------------------------------------- | |
id | integer | not null default nextval('users_seq'::regclass) | |
username | character varying | not null | |
password | character varying | not null | |
create_date | timestamp without time zone | default now() | |
Indexes: | |
"users_pkey" PRIMARY KEY, btree (id) | |
"users_username_key" UNIQUE CONSTRAINT, btree (username) | |
Referenced by: | |
TABLE "postit" CONSTRAINT "fk_pi_userid" FOREIGN KEY (userid) REFERENCES users(id) | |
TABLE "user_info" CONSTRAINT "fk_ui_userid" FOREIGN KEY (userid) REFERENCES users(id) | |
postit=> select users from users; | |
users | |
----------------------------------------------------- | |
(0,anonymous,anonymous,"2016-03-08 12:40:01.45153") | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment