Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types
Дата
Msg-id 23630.1497488548@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] BUG #14706: Dependencies not recorded properly for base types  (khuddleston@pivotal.io)
Ответы Re: [BUGS] BUG #14706: Dependencies not recorded properly for basetypes  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-bugs
Karen Huddleston <khuddleston@pivotal.io> writes:
> I didn't actually realize it was deprecated style. I'm not super familiar
> with the syntax for creating types and functions. Which part is deprecated
> and what should it be instead?

The way you're supposed to make a new type nowadays is

CREATE TYPE base_type;   -- make a shell type

CREATE FUNCTION base_fn_in(cstring) returns base_type as ...
CREATE FUNCTION base_fn_out(base_type) returns cstring as ...

-- convert shell to real type
CREATE TYPE base_type(input=base_fn_in, output=base_fn_out);

In this way the function signatures are legal from the get-go,
and the dependencies are right too.  The business with "opaque"
as a placeholder has been deprecated for circa 15 years; did
you find that example in any modern documentation?
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types