Re: Multiple tables row insertions from single psql input file

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Multiple tables row insertions from single psql input file
Дата
Msg-id CAKFQuwZGsnB680tLxDyrkDoz-BNesF=s1xL1CCGsieLK=5P1Vg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Multiple tables row insertions from single psql input file  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Multiple tables row insertions from single psql input file [RESOLVED]
Список pgsql-general
On Mon, Jun 10, 2024 at 2:58 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:

INSERT into companies (company_nbr,company_name,industry,status) VALUES
nextval('companies_org_nbr_seq'),'Acme','Manufacturing','Opportunity'),
nextval('companies_org_nbr_seq'),'Baker','Livestock','Opportunity');

Running:
$ psql -U rshepard -d bustrac -f test-script.sql
psql:test-script.sql:3: ERROR:  syntax error at or near "nextval"
LINE 2: nextval('companies_org_nbr_seq'),'Acme','Manufacturing','Opp...
         ^
What have I missed?


Values introduces literal records/rows.  Rows are written within parentheses.
Values (..., ...), (..., ...)

You seem to have the closing parenthesis but not the opening one.

David J.

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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Multiple tables row insertions from single psql input file
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Multiple tables row insertions from single psql input file [RESOLVED]