What does "INSERT 0 1" mean after executing direct SQL in PostgreSQL?
Dec 6
When I execute a file containing SQL commands with psql -f, I get output like this (truncated):
CREATE DOMAIN
CREATE TABLE
CREATE TABLE
INSERT 0 1
INSERT 0 1
INSERT 0 1
What do the numbers 0 and 1 mean? (I think 1 is the number of rows modified. But 0?) I can't find it in PostgreSQL's official documentation or anywhere else.
1 answer
Accepted answer · original discussion
Dec 6
This is documented with the INSERT command
On successful completion, an INSERT command returns a command tag of the form
INSERT oid countThe count is the number of rows inserted or updated. oid is always 0 (it used to be the OID assigned to the inserted row if count was exactly one and the target table was declared WITH OIDS and 0 otherwise, but creating a table WITH OIDS is not supported anymore).
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.