Re: "Naked" typecast functions?

Federico Di Gregorio <fog-NGVKUo/i/[email protected]> Thu, 22 Apr 2010 12:03:02 +0200
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On 22/04/2010 10:07, Peter Sabaini wrote:
> Does this also work with arrays? (There seems to something there in the
> C implementation, eg. psycopg2._psycopg.STRINGARRAY(), but I guess this
> works the other way around;
>>>> >>> psycopg2._psycopg.STRINGARRAY("{a, b}", None)
> ['a', ' b']
> )

What do you mean by "the other way around"? Typecasters work exactly
this way, they convert from PostgreSQL (string representation) to
Python. Btw, use psycopg2.extensions, not psycopg2._psycopg.

-- 
Federico Di Gregorio                                       fog-NGVKUo/i/[email protected]
 Credo fermamente che da qualche parte, in una scatola ci sia un gatto
  che non è vivo ne morto. Credo anche che se i fisici non si sbrigano
  a dargli una scatoletta, ben presto sarà solo morto.
                              -- adattato da una frase di Sam Black Crow

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 262 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQHt0ACgkQvcCgrgZGjeu8tQCgqbdptyn5BPj/YNlhmXGRHebx
zE4AoI1ryvOlzInA3DSFrzlvDzuWdA0x
=UA4b
-----END PGP SIGNATURE-----