Pastebin
Paste #23896: No description
< previous paste - next paste>
Pasted by Anonymous Coward
ahd=> \d user
Table "public.user"
Column | Type | Collation | Nullable | Default
----------+-----------------------+-----------+----------+----------------------------------
id | integer | | not null | nextval('user_id_seq'::regclass)
username | character varying(50) | | |
password | text | | |
Indexes:
"user_pkey" PRIMARY KEY, btree (id)
Referenced by:
TABLE "post" CONSTRAINT "fk_user" FOREIGN KEY (user_id) REFERENCES "user"(id)
ahd=> SELECT * FROM "user";
id | username | password
----+-------------+-------------------
1 | ahd | typewriter
2 | random_dude | insecure_password
9 | Idiot | 1234567890
(3 rows)
ahd=> SELECT id FROM "user";
id
----
1
2
9
(3 rows)
ahd=> SELECT id FROM "user" WHERE username = 'ahd' AND password = 'typewriter';
id
----
1
(1 row)
ahd=> SELECT COUNT(id) FROM "user" WHERE username = 'ahd' AND password = 'typewriter';
count
-------
1
(1 row)
ahd=> SELECT COUNT(id) FROM "user" WHERE username = 'ahd' AND password = 'typewridsafter';
count
-------
0
(1 row)
ahd=>
New Paste
Go to most recent paste.