Re: generic pseudotype IO functions?

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: generic pseudotype IO functions?
Date: 2014-01-06 15:36:32
Message-ID: 20140106153632.GA15265@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-01-06 10:29:06 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > Does anybody have an opinion about introducing generic pseudotype IO
> > functions?
>
> Yes: -1.

Ok, fine with me.

> > Pseudotype.c/pg_proc.h are slowly growing a number of pretty
> > useless/redundant copy&pasted functions... Most for cases that are
> > pretty damn unlikely to be hit by users not knowing what they do.
>
> That's hardly the largest cost associated with inventing a new pseudotype.
> Nor are there lots of new pseudotypes coming down the pike, anyway.

Robert suggested modelling the lookup of changeset extraction output
callbacks after fdw's FdwRoutine, that's why I am wondering about
it. I noticed while reviewing that I so far had borrowed fdw's C
routines which didn't seem like such a nice thing to do...

> > What about adding a pseudotype_in/out that just error out with a generic
> > message?
>
> This will break some of the function sanity checks in opr_sanity,
> I believe. Yeah, we could lobotomize that, but I don't see any benefit.

Yes. But there's precedent in refcursor using text's routines...

(it's in type_sanity, but whatever)

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masterprojekt Naumann1 2014-01-06 15:49:59 Re: Convert Datum* to char*
Previous Message Tom Lane 2014-01-06 15:29:06 Re: generic pseudotype IO functions?