Re: [GENERAL] 9.6.1: INSERT with PK as serial

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [GENERAL] 9.6.1: INSERT with PK as serial
Дата
Msg-id CAKJS1f8cEEsS9O7YtChsgJGwoF6=PFjxbb=8fziddo4+qWTq_Q@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] 9.6.1: INSERT with PK as serial  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: [GENERAL] 9.6.1: INSERT with PK as serial
Список pgsql-general
On 17 January 2017 at 12:44, Rich Shepard <rshepard@appl-ecosys.com> wrote:
>   I have a table with the primary key type of serial. The initial data load
> has 40 lines, and each has a value for every column including sequential
> integers from 1 through 40 for the data. When I try to read it in using
> 'psql -d <database_name> -f <filename.sql>' I get a syntax error at the
> second word in the string that is column 2. The error message does not print
> the integer PK. If it matters, I have all 14 columns specified but not
> explicitly named in the INSERT INTO command.
>
>   I've looked in the manual without learning how to INSERT data in a table
> with a serial PK and need to learn how to do this.

You may have more luck getting an answer if you include the statement
causing the problem.

If you're not specifying the column names, then the VALUES list must
have the same number of values, in the same order as the columns
defined on the table.

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: [GENERAL] 9.6.1: INSERT with PK as serial
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: [GENERAL] 9.6.1: INSERT with PK as serial