Re: Unique UUID value - PostgreSQL 9.2

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Unique UUID value - PostgreSQL 9.2
Дата
Msg-id CAKFQuwa26N2OnKEt_zsVoe0FEoq4n=jydGXNWQm25SAOzFyNBA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Unique UUID value - PostgreSQL 9.2  ("drum.lucas@gmail.com" <drum.lucas@gmail.com>)
Ответы Re: Unique UUID value - PostgreSQL 9.2  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Mon, Mar 14, 2016 at 3:51 PM, drum.lucas@gmail.com <drum.lucas@gmail.com> wrote:
I just need to know how can I do all of this

​You may have missed my prior email.

You cannot COPY directly into the target table.  You must copy to a staging table.  You then insert from the staging table to the target table, listing every single column, and replacing those columns you want to change with some kind of expression.

Basically:

INSERT INTO targettable (col1, col2, col3)
SELECT col1, col2 || '_' || nextval('sequence_name')::text, col3
FROM stagingtable;

David J.

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

Предыдущее
От: "drum.lucas@gmail.com"
Дата:
Сообщение: Re: Unique UUID value - PostgreSQL 9.2
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Unique UUID value - PostgreSQL 9.2