Re: making functions take arrays

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kyle <kaf(at)nwlink(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: making functions take arrays
Date: 2001-02-12 18:11:01
Message-ID: 19197.982001461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kyle <kaf(at)nwlink(dot)com> writes:
> Is it possible to make a compiled C function take an array as an
> argument?

Sure, although disassembling the array is not quite trivial (a Postgres
array is not the same as a C array). In the 7.1 code, there is a
deconstruct_array() function in src/backend/utils/adt/arrayfuncs.c
that will help.

> Also, how do I return an SQL NULL from a function?

In 7.0, you don't. In 7.1, see src/backend/utils/fmgr/README.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nelio Alves Pereira Filho 2001-02-12 18:36:05 System Tables
Previous Message Kyle 2001-02-12 17:50:27 making functions take arrays