Re: BUG #15198: nextval() accepts tables/indexes when adding adefault to a column

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #15198: nextval() accepts tables/indexes when adding adefault to a column
Дата
Msg-id CAKFQuwYCgnmCLsE9nNAjVupMrfRrU0O_PnQoTzZSO-gA__ooiw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #15198: nextval() accepts tables/indexes when adding adefault to a column  (Feike Steenbergen <feikesteenbergen@gmail.com>)
Список pgsql-bugs
On Wed, May 16, 2018 at 11:41 PM, Feike Steenbergen <feikesteenbergen@gmail.com> wrote:
+       if (!IsSequence( find_oid_referenced (defobject) ) )
+               elog(ERROR, "Column defaults can only depend on sequences")

​Except column defaults can depends on lots of things - its only if the column default happens to invoke nextval that the specific type of object being passed to nextval needs to be a sequence.

You might be able to stick "something" in the recordDependencyOnExpr(&defobject, expr, NIL, DEPENDENCY_NORMAL); call (have gone and found that code...) but catalog/heap.c:: StoreAttrDefault itself doesn't operate at the level of detail.

Ultimately you'd have to add a hack for the function name nextval...

David J.

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

Предыдущее
От: Huong Dangminh
Дата:
Сообщение: RE: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15204: Export to CSV doesn't work in Query tools