Re: Overriding default psql behavior | how to ignore missing fields

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Overriding default psql behavior | how to ignore missing fields
Дата
Msg-id iflha6$723$1@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Overriding default psql behavior | how to ignore missing fields  (Håvard Wahl Kongsgård <haavard.kongsgaard@gmail.com>)
Список pgsql-general
On 2010-12-31, Håvard Wahl Kongsgård <haavard.kongsgaard@gmail.com> wrote:
> --90e6ba488359a7721f0498b43825
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
> I am trying to insert new records from multiple SQL dumps into an existing
> table. My problem is that the database table does not have some of the
> columns used in the sql dumps. So when I try to import the dumps psql fails
> with: "ERROR:  current transaction is aborted, commands ignored until end o=
> f
> transaction block"
>
> As there are thousands of files with multiple missing fields, manually
> adding every field to the table is not a option.

In that case you'll need to do that automatically (write some software),
or find some other way to load the data.

> Is it possible to overriding the default psql behavior, so that the sql
> session simply ignores any missing fields?

no.


Perhaps load the tables into a temporary database and then copy the
columns you want, or drop the columns you dont and dump the whole
thing...

--
⚂⚃ 100% natural

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: seg fault crashed the postmaster
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Overriding default psql behavior | how to ignore missing fields