diff options
| author | Federico Di Gregorio <fog@initd.org> | 2005-03-23 00:43:36 +0000 |
|---|---|---|
| committer | Federico Di Gregorio <fog@initd.org> | 2005-03-23 00:43:36 +0000 |
| commit | cddb1a15d4789ebc08ac4dfc73f1ebffe8fce836 (patch) | |
| tree | 48aa8ecb3e3af4635d2ccce0494a08dc782fe5b2 /sandbox/array.py | |
| parent | def14d59255fbff8620d31c8cb07f1d06ba1657d (diff) | |
| download | psycopg2-cddb1a15d4789ebc08ac4dfc73f1ebffe8fce836.tar.gz | |
Array quoting (not completely working.)
Diffstat (limited to 'sandbox/array.py')
| -rw-r--r-- | sandbox/array.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sandbox/array.py b/sandbox/array.py new file mode 100644 index 0000000..b9975a0 --- /dev/null +++ b/sandbox/array.py @@ -0,0 +1,15 @@ +import psycopg + +conn = psycopg.connect("dbname=test") +curs = conn.cursor() + +curs.execute("SELECT ARRAY[1,2,3] AS foo") +print curs.fetchone() + +curs.execute("SELECT ARRAY['1','2','3'] AS foo") +print curs.fetchone() + +curs.execute("""SELECT ARRAY['','"',''] AS foo""") +d = curs.fetchone() +print d, '->', d[0][0], d[0][1], d[0][2] + |
