RE: [HACKERS] need help for array appending & deleting

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Blazso <blazso(at)deltav(dot)hu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: RE: [HACKERS] need help for array appending & deleting
Date: 1999-09-01 14:33:55
Message-ID: 1B3D5E532D18D311861A00600865478C25E540@exchange1.nt.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Also (coming late into this conversation), Array support in the JDBC2
driver is on the cards for 6.6.

Peter

--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: 01 September 1999 15:05
To: Peter Blazso
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] need help for array appending & deleting

Peter Blazso <blazso(at)deltav(dot)hu> writes:
> Unless it exists, I'd like to implement code for the array
manipulations
> above for Postgresql. and I need some help for it. I have already run
> through the sources concerned but I need to be pointed to the right
> direction on where to start and what kind of functions I should use.
I'd
> also like to have a bit more detailed info on array structure (or at
> least where I can find a good doc. I've been looking for it in
> 'array.h', 'arrayutils.c' and 'arrayfuncs.c').

What's in the code is all there is :-(. Please consider improving the
documentation once you have studied the code enough to understand what's
going on.

I recall having looked at that stuff recently, and IIRC the general
structure of an array inside the backend is

Overall length word (required for any VARLENA type)
a couple words of fixed overhead
dimension info array (1 entry per dimension)
array elements, in sequence

I don't recall the sequence that's used (row or column major). Also,
I think the array elements are aligned on INTALIGN boundaries, which
is pretty bogus --- arrays of doubles would fail on a lot of hardware.
The code should either use MAXALIGN always, or better use the specific
alignment needed for the array element type (as indicated by the pg_type
data).

BTW, please be sure you are working with current sources and not REL6_5
branch. I've already fixed a bunch of parser/optimizer problems with
arrays; you shouldn't have to reinvent those changes.

regards, tom lane

************

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1999-09-01 14:41:56 Re: [HACKERS] Changes for 6.5.2 ?
Previous Message Oleg Bartunov 1999-09-01 14:13:15 Re: [HACKERS] Changes for 6.5.2 ?