What does the result output after a PostgreSQL insert mean exactly?
postgresql
Solution
It's the "command tag". And the guy that was quoted here answering on the pgsql general list list didn't give credit when he quoted directly from the manual:
For an `INSERT` command, the tag is `INSERT` `oid rows`, where `rows` is the number of rows inserted. `oid` used to be the object ID of the inserted row if `rows` was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore `oid` is always 0.
(Updated quote for Postgres 14.)
Problem
I am inserting data into a PostgreSQL database. I do something like this: ``` $ psql test -c "insert into items (name) values ('test name') returning id " -At 4 INSERT 0 1 ``` What does the first number in `INSERT 0 1` refer to? I assume the second number is the number of rows affected or created.