"Usage" Section In "Create Sequence"

Поиск
Список
Период
Сортировка
От cn
Тема "Usage" Section In "Create Sequence"
Дата
Msg-id 3A00B86D.85A83CC4@mail.sinyih.com.tw
обсуждение исходный текст
Список pgsql-docs
Hi!

Perhaps I misunderstood its logic - I think the following example
illusated in man page "create_sequence" and
"http://www.postgresql.org/devel-corner/docs/postgres/sql-createsequence.htm":

CREATE FUNCTION distributors_id_max() RETURNS INT4
    AS 'SELECT max(id) FROM distributors'
    LANGUAGE 'sql';
BEGIN;
    COPY distributors FROM 'input_file';
    SELECT setval('serial', distributors_id_max());
END;

is intended to be:

CREATE FUNCTION distributors_id_max() RETURNS INT4
    AS 'SELECT max(id)+1 FROM distributors' -- !NOTE HERE
    LANGUAGE 'sql';
BEGIN;
    COPY distributors FROM 'input_file';
    SELECT setval('serial', distributors_id_max());
END;

Regards,

CN

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: question regarding grant privilege
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Documentation build things