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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karen Huddleston <khuddleston(at)pivotal(dot)io>
Cc: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: BUG #14706: Dependencies not recorded properly for base types
Date: 2017-06-15 01:02:28
Message-ID: 23630.1497488548@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Karen Huddleston <khuddleston(at)pivotal(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2017-06-15 04:52:01 Re: BUG #14706: Dependencies not recorded properly for base types
Previous Message Tom Lane 2017-06-15 00:42:16 Re: BUG #14706: Dependencies not recorded properly for base types