Re: Definging columns for INSERT statements

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Definging columns for INSERT statements
Дата
Msg-id 61398511-e28d-f9bd-d44-33a69a1c55@appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Definging columns for INSERT statements  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Definging columns for INSERT statements
Список pgsql-general
On Wed, 12 Jun 2024, Adrian Klaver wrote:

> Assuming 'people_person_nbr_seq' is the sequence attached to person_nbr
> and the other DEFAULTs are the column defaults then the syntax would be:
>
> INSERT INTO people
> (person_nbr, lname, fname, job_title, company_nbr,loc_nbr, direct_phone, 
> cell_phone,email, active)
> VALUES
> (DEFAULT, 'klaver', 'adrian', DEFAULT, 1, 1, '555-1234', '555-4321', 
> 'adrian.klaver@aklaver.com', DEFAULT);
>
> If they are not the column defaults then just supply the literal value.

Adrian,

No matter how many postgres docs and web pages I read I didn't find an
example as explicit as yours. Columns other than the person_nbr were not
defined with defaults and I expected to enter them for each row.

Many thanks for another valuable lesson.

Best regards,

Rich



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: PG16.1 security breach?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Definging columns for INSERT statements