Excerpted from the page in the manual :
Exits
On successful completion of an INSERT command it returns a command tag of the form:
INSERT [oid] [count]
Count [count] is the number of rows entered. If the [count] count is exactly UMA and the target table has OIDs enabled, the OID is assigned to the inserted row. Otherwise OID is zero.
OIDs are used internally by PostgreSQL as primary keys in several system tables. It would be about the same as Oracle's ROWID .
Exemplifying:
OID will only appear if you INSERT a LINE. Because the return is unique (single return), so it is shown 0 for insertion of many records, but behind it is generated the OID for each record inserted in the table. (unless WITHOUT OIDS is specified in the table creation, or the default_with_oids configuration variable is set to false.)
Running some INSERT's:
INSERT INTO t VALUES ('x', 'x', 'x');
INSERT INTO t VALUES ('x', 'x', 'y');
INSERT INTO t VALUES ('x', 'y', 'x');
INSERT INTO t VALUES ('x', 'x', 'y');
INSERT INTO t VALUES ('x', 'x', 'y');
INSERT INTO t VALUES ('x', 'y', 'y');
INSERT INTO t VALUES ('y', 'y', 'y');
INSERT INTO t VALUES ('y', 'y', 'y');
SELECT oid, t.* FROM t;
oid | c1 | c2 | c3
-------+----+----+----
17839 | x | x | x
17840 | x | x | y
17841 | x | y | x
17842 | x | x | y
17843 | x | x | y
17844 | x | y | y
17845 | y | y | y
17846 | y | y | y
(8 linhas)
Each record is assigned a OID
different, internally each record (line) is a different object.
DELETE FROM t WHERE oid NOT IN
(SELECT min(oid) FROM t GROUP BY c1, c2, c3);
DELETE 3
SELECT oid, t.* FROM t;
oid | c1 | c2 | c3
-------+----+----+----
17839 | x | x | x
17840 | x | x | y
17841 | x | y | x
17844 | x | y | y
17845 | y | y | y