integer arrays

From: mlw <markw(at)mohawksoft(dot)com>
To: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: integer arrays
Date: 2001-04-16 19:18:55
Message-ID: 3ADB459F.D6F5631D@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have looked and I have looked, it is not immediately clear to me how integer
arrays are passed to C function.

create table fubar (vars integer[]) ;

select c_function(vars) from fubar;

insert into fubar (vars) values ('{1,2,3,4,5,6}');

........

extern "C" c_function (varlena var)
{
int * pn = (int *)VARDATA(var);
}

Now, what should "pn" have in it? I don't see my values until later on in the
array. I guess I am asking is what is the format of this type, and more
importantly, where is it documented. I looked in catalog and pg_types but it
wasn't clear it was defined there.

--

I'm not offering myself as an example; every life evolves by its own laws.
------------------------
http://www.mohawksoft.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-04-16 19:49:36 Re: integer arrays
Previous Message Lamar Owen 2001-04-16 18:24:08 Re: 7.1 on 7.1