Re: Array with a lower bound>1, PostgreSQL 8.3.6
Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Organization | initd.org |
| Message-ID | <[email protected]> |
Il giorno mar, 24/02/2009 alle 14.22 +0100, Thomas Jacob ha scritto:
> Hello List,
>
> I was wondering if there are any plans to properly support arrays with a
> lower bound greater than one:
>
> CREATE TABLE test ( a TEXT[]);
> INSERT INTO test values ('[100:100]={}');
>
> SELECT * FROM test;
> a
> ---------------
> [100:100]={1}
>
>
> SELECT a[100],a[10] IS NULL FROM test;
>
> 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. 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.
federico
--
Federico Di Gregorio http://people.initd.org/fog
Debian GNU/Linux Developer [email protected]
INIT.D Developer fog-NGVKUo/i/[email protected]
If a process is potentially good, but 90%+ of the time smart and
well-intentioned people screw it up, then it's a bad process.
-- Steve Yegge
_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkmkVWwACgkQvcCgrgZGjesypACeOHIpg6jdlGTzFtbJZ7VVmeC+ FUEAnj5Xnxieufu63QhR7sFxJGIN5dU9 =l9q1 -----END PGP SIGNATURE-----