Re: Array with a lower bound>1, PostgreSQL 8.3.6
Thomas Jacob <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2009-02-25 at 10:06 +0100, Karsten Hilbert wrote:
> On Tue, Feb 24, 2009 at 05:07:46PM +0100, Thomas Jacob 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?
>
> Sure.
Could you kindly point me in the right direction here? I haven't
come across an example or docs that talk about type adaptors yet.
Thanks.
Thomas