Interview Q&A / PostgreSQL

INTERVIEW Q&A · 69 QUESTIONS

PostgreSQL interview questions

Indexes, EXPLAIN, transactions and isolation, JSONB and the Postgres specifics backend interviews probe.

  1. What is the difference between SERIAL and IDENTITY columns, and when would you use a UUID primary key?

    SERIAL is an older PostgreSQL shorthand that creates a sequence and sets it as the column default. IDENTITY (GENERATED ALWAYS or BY DEFAULT AS IDENTITY) is the SQL-standard replacement and is preferred for new tables. Use a UUID when IDs must be generated outside the database, merged across systems, or must not be guessable.

    BeginnerIn-depth3 min read