Re: Mysterious Bus Error with get_fn_expr_argtype()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Neil Conway" <neilc(at)samurai(dot)com>
Cc: "Brendan Jurd" <direvus(at)gmail(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Mysterious Bus Error with get_fn_expr_argtype()
Date: 2008-09-02 04:57:22
Message-ID: 5350.1220331442@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Neil Conway" <neilc(at)samurai(dot)com> writes:
> On Mon, Sep 1, 2008 at 9:35 PM, Brendan Jurd <direvus(at)gmail(dot)com> wrote:
>> +1. I've been using a variation on this theme (it returns the type
>> OID, not a text value) for a couple of years.

> Returning regtype seems like the natural choice.

I was just about to say the same. Another thought is that you might as
well declare the input type as "any" --- using "anyelement" just causes
the parser to waste a few cycles checking for argument/result type
conflicts that can't exist here.

I don't like gettype() as the function name: it's not particularly
readable and it seems to infringe on application namespace. It should
be pg_something ... maybe pg_typeof() ?

Oh, another thing: it shouldn't be STRICT. Nulls have perfectly good
types.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hitoshi Harada 2008-09-02 05:03:38 Re: Window functions patch v04 for the September commit fest
Previous Message Hitoshi Harada 2008-09-02 04:46:46 Re: Window functions patch v04 for the September commit fest