public inbox for [email protected]  
help / color / mirror / Atom feed
From: Rich Shepard <[email protected]>
To: [email protected]
Subject: Re: Reset sequence to current maximum value of rows
Date: Thu, 13 Jun 2024 13:09:51 -0700 (PDT)
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANzqJaB0OeAchVgnTznmPTbo9Y-H9r9g7S=TqJb25eX_KodcRA@mail.gmail.com>
References: <[email protected]>
	<CANzqJaAavydD4XMgkXRUQ_=aAFOGBMVBCKfeB0PnhrZrAWbgng@mail.gmail.com>
	<[email protected]>
	<CANzqJaB0OeAchVgnTznmPTbo9Y-H9r9g7S=TqJb25eX_KodcRA@mail.gmail.com>

On Thu, 13 Jun 2024, Ron Johnson wrote:

> No need to do that.  Just write:
> INSERT INTO public.companies (company_name, , industry, status)
>    VALUES ('Berkshire Hathaway', 'Conglomerate', 'Mumble');
>
> The next value of companies_org_nbr_seq will automatically be taken and
> inserted  into the table.

Ron,

Aha! So it's likely that by listing the PK column name in the list of
columns to be inserted was what caused the problem? No need to specify
DEFAULT for it?

I'm writing a script to enter all contact within these companies. I'll leave
out 'person_nbr' in the list of columns and DEFAULT at the beginning of the
VALUES () section.

I didn't pick this up in my readings.

Thank you,

Rich






view thread (7+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Reset sequence to current maximum value of rows
  In-Reply-To: <[email protected]>

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

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