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 09:15:40PM +0100, Federico Di Gregorio wrote: > > Intuitively I'd expect result columns to behave in a similar > > way, with the result array looking like: > > > > [None for x in xrange(99) ].append(1) > > I don't agree on that. An array starting at 0 with 99 NULL values (None > is almost always mapped to NULL) is completely different from an array > of 1 value starting at 100. That's why the dicts-of-dicts idea where the array indices are the dict keys -- because they are considered-to-be-sequential labels rather than true indices. > I don't have a clear idea about how to map > the array but surely I want the _length_ be the same in both postgresql > and Python. The dict would do that, wouldn't it ? Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346