79659934

Date: 2025-06-10 06:56:44
Score: 1
Natty:
Report link

When you insert into an table it returns to you INSERT oid count

The oid is the object identifier of the newly inserted row and count is the number of the rows inserted. Since the PostgresSQL 12, oid's are deprecated that's way it always returns zero.

If you want to use oids then it will only work in PostgresSQL < 12

and do so create the table as below

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    username VARCHAR(50) UNIQUE NOT NULL,
) WITH OIDS;
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you in
  • Low reputation (1):
Posted by: yash gorde