Re: Insert results in 0 1

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Sherman Willden <operasopranos(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Insert results in 0 1
Date: 2018-01-16 02:13:28
Message-ID: D085675C-E993-4BDD-BDD4-5AC815A4B298@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On Jan 15, 2018, at 5:57 PM, Sherman Willden <operasopranos(at)gmail(dot)com> wrote:
>
> Computer HP Compaq 6710b
> Development Platform: Ubuntu 17.10 mainly command line work
> Tools: perl 5.26 and postgresql 9.6
>
> Why do I get a 0 1 when using insert?
>
> Thanks;
>
> Sherman
> classical=# INSERT INTO string_groups VALUES('et_b_02', 'Sonata in B minor', 'Eroica Trio', 'Jean Baptiste Loeillet', 'Baroque');
> INSERT 0 1
> classical=# INSERT INTO string_groups VALUES('et_b_02', 'Sonata in B minor', 'Eroica Trio', 'Jean Baptiste Loeillet', 'Baroque');
> ERROR: duplicate key value violates unique constraint "string_groups_pkey"
> DETAIL: Key (id)=(et_b_02) already exists.
>
On successful completion, an INSERT command returns a command tag of the form

INSERT oid count
The count is the number of rows inserted or updated. If count is exactly one, and the target table has OIDs, then oid is the OID assigned to the inserted row. The single row must have been inserted rather than updated. Otherwise oid is zero.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2018-01-16 05:36:17 Re: Insert results in 0 1
Previous Message Neto pr 2018-01-16 01:54:08 Re: why SSD is slower than HDD SAS 15K ?