Re: user defined function - Mailing list pgsql-general

From Tom Lane
Subject Re: user defined function
Date
Msg-id 19162.1138118200@sss.pgh.pa.us
Whole thread Raw
In response to Re: user defined function  (Richard Huxton <dev@archonet.com>)
Responses Re: user defined function  (Yl Zhou <andrew.ylzhou@gmail.com>)
List pgsql-general
Richard Huxton <dev@archonet.com> writes:
> Tom Lane wrote:
>> You could do that in C, but none of the available PLs support it.

> How would you define the signature for the function? One parameter of
> type anyelement?

Type RECORD would be a better choice --- ANYELEMENT allows scalar types
which is not what you want here.  (You could probably still do it with
a function declared that way, but it'd have to take extra steps to
defend itself against being passed, say, an integer.)

If you're looking for a coding model, stripping down record_out() to
just count nulls should get you there.

            regards, tom lane

pgsql-general by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Does this look ethical to you?
Next
From: Tom Lane
Date:
Subject: Re: