pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Automatic PK values not added to new rows
Date: Wed, 25 May 2022 16:09:17 -0700 (PDT)
Message-ID: <452c4b59-d43a-f413-114-e35bd5f9d3d2@appl-ecosys.com> (raw)
In-Reply-To: <6d67d16b-7cdd-2f40-9ebe-82a499eb11c2@gmx.net>
References: <e4a17cde-9941-5eb5-e88d-246577e4488c@appl-ecosys.com>
	<c8e3b0d2-dd92-3764-74c2-fb70b6b8bbc4@aklaver.com>
	<dcb54853-9a90-df81-77d6-9f9dce93ce18@appl-ecosys.com>
	<6d67d16b-7cdd-2f40-9ebe-82a499eb11c2@gmx.net>

On Wed, 25 May 2022, Thomas Kellerer wrote:

> If you want to prevent such a situation in the future, you might want to
> consider defining those columns as "generated always as identity" instead
> of "serial".
>
> Then you'd get an error if you try to bypass the database generated values.

Thanks, Thomas.

Rich





view thread (13+ messages)  latest in thread

Message-ID: <452c4b59-d43a-f413-114-e35bd5f9d3d2@appl-ecosys.com>
Permalink:  ../452c4b59-d43a-f413-114-e35bd5f9d3d2@appl-ecosys.com/
Also on:    postgresql.org/message-id/452c4b59-d43a-f413-114-e35bd5f9d3d2@appl-ecosys.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: rshepard@appl-ecosys.com
  Subject: Re: Automatic PK values not added to new rows
  In-Reply-To: <452c4b59-d43a-f413-114-e35bd5f9d3d2@appl-ecosys.com>
  References: <e4a17cde-9941-5eb5-e88d-246577e4488c@appl-ecosys.com> <c8e3b0d2-dd92-3764-74c2-fb70b6b8bbc4@aklaver.com> <dcb54853-9a90-df81-77d6-9f9dce93ce18@appl-ecosys.com> <6d67d16b-7cdd-2f40-9ebe-82a499eb11c2@gmx.net> <452c4b59-d43a-f413-114-e35bd5f9d3d2@appl-ecosys.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox