diff options
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] + |
