Re: Array with a lower bound>1, PostgreSQL 8.3.6

Karsten Hilbert <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Tue, Feb 24, 2009 at 02:22:34PM +0100, Thomas Jacob wrote:

> I was wondering if there are any plans to properly support arrays with a
> lower bound greater than one:

Well, we may first need to get the semantics straight.

If the lower bound isn't "natural" (as in 0 or 1, whatever
seems natural to the problem at hand) it becomes arbitrary -
a label rather than an index. In those weird cases where the
label seems to be an index it really just stands for the
real index (label "100" == real index at offset 100).

Given arbitrary labels we don't speak about mapping
PostgreSQL arrays to Python lists-of-lists anymore, I would
therefore suggest mapping non-"natural" arrays to ordered
(?) dicts-of-dicts with integer keys.

This was just a primer for discussion - I heartily invite
criticism :-)

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.