Re: Reset sequence to current maximum value of rows

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Reset sequence to current maximum value of rows
Дата
Msg-id bcf7b38-857e-b44c-a0c5-71bfc1f52b9c@appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Reset sequence to current maximum value of rows  (Ron Johnson <ronljohnsonjr@gmail.com>)
Ответы Re: Reset sequence to current maximum value of rows
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Reset sequence to current maximum value of rows
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Reset sequence to current maximum value of rows