Re: Array with a lower bound>1, PostgreSQL 8.3.6
Tim Roberts <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Organization | Providenza & Boekelheide, Inc. |
| Message-ID | <[email protected]> |
Thomas Jacob wrote: > On Tue, 2009-02-24 at 16:36 +0100, Karsten Hilbert wrote: > >> 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. >> > > That would probably be easiest and most memory efficient, but > I think it would also be bit awkward to have different to get different > types depending on the value of the column, and it would probably > break old code. > > Would it be possible to have a configurable type adaptor > (don't really what those are yet), so that people could choose > which behavior they want? Lists or dicts of dicts? Well, if you will allow me to throw a spanner into the works, I would point out that arrays are a rarely used feature to begin with. They are not standard SQL; they are strictly a Postgres extension, and kind of a hacky one at that. If you have found the ideal application for Postgres arrays, then I have no doubt that Federico would welcome your contribution of a working adapter with open arms and a hearty pat on the back, with whatever semantics are sensible for you, but I'm not sure you'll get many others fired up about helping. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc.