backendgym backendgym · reps Sign in with GitHubSign in

02Bind typed values

sql-scaling-and-security / reps/02/README.md

Three values whose type decides what you get back. Prepare a statement that takes an integer account ID and returns that account's balance, and execute it for Alice. Then select the interval '90 minutes', and look up the identity setting of accounts.id in information_schema.columns.

Expected: Alice's balance is 100.00, the interval prints as 01:30:00, and accounts.id has ALWAYS identity generation.

After the rep
  1. 1 Run EXECUTE with '1 OR 1=1' as the account ID. What does Postgres answer, and why can't that text reach the WHERE clause?