SHARE
TWEET

Untitled

a guest May 19th, 2017 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sw2_std=# CREATE TABLE q (id bigserial NOT NULL PRIMARY KEY);
  2. NOTICE:  CREATE TABLE will CREATE implicit SEQUENCE "q_id_seq" FOR serial COLUMN "q.id"
  3. NOTICE:  CREATE TABLE / PRIMARY KEY will CREATE implicit INDEX "q_pkey" FOR TABLE "q"
  4. CREATE TABLE
  5. sw2_std=# \d q
  6.                          TABLE "public.q"
  7.  COLUMN |  TYPE  |                   Modifiers
  8. --------+--------+------------------------------------------------
  9.  id     | BIGINT | NOT NULL DEFAULT NEXTVAL('q_id_seq'::regclass)
  10. Indexes:
  11.     "q_pkey" PRIMARY KEY, btree (id)
  12.  
  13. sw2_std=# INSERT INTO q VALUES (2);
  14. INSERT 0 1
  15. sw2_std=# INSERT INTO q VALUES (DEFAULT);
  16. INSERT 0 1
  17. sw2_std=# INSERT INTO q VALUES (DEFAULT);
  18. ERROR:  duplicate KEY VALUE violates UNIQUE CONSTRAINT "q_pkey"
RAW Paste Data
Top