Re: Mysql -> Postgresql pitfalls

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Mysql -> Postgresql pitfalls
Дата
Msg-id 1060030888.91190.22.camel@jester
обсуждение исходный текст
Ответ на Re: Mysql -> Postgresql pitfalls  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-docs
> speak in the \copy command.  I.e. you wouldn't use inserts to load your
> data, you'd use a bulk copy, which bypassess all the serial / IDENTITY
> stuff.  Basically, with the IDENTITY type, if you try to insert a value,

COPY enforces everything that insert does.  It's simply a little quicker
than insert due to a different string parsing method and avoiding places
that are for advanced features (subselects, functions, etc.).

A default is still applied if the column has not been provided.
Likewise, triggers (constraint triggers anyway) still run.

Bumping the start value for an IDENTITY is simple:

CREATE TABLE tab (
 col integer GENERATED ALWAYS AS IDENTITY(START WITH 42)
);

I suppose we'll need a GUC so that GENERATED ALWAYS isn't actually
always -- just usually.

Вложения

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

Предыдущее
От: "Chad N. Tindel"
Дата:
Сообщение: Re: Mysql -> Postgresql pitfalls
Следующее
От: Lamar Owen
Дата:
Сообщение: Re: Mysql -> Postgresql pitfalls