Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types
Date
Msg-id 23630.1497488548@sss.pgh.pa.us
Whole thread Raw
In response to [BUGS] BUG #14706: Dependencies not recorded properly for base types  (khuddleston@pivotal.io)
Responses Re: [BUGS] BUG #14706: Dependencies not recorded properly for basetypes  (Heikki Linnakangas <hlinnaka@iki.fi>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types
Next
From: Michael Paquier
Date:
Subject: Re: [BUGS] BUG #14706: Dependencies not recorded properly for base types