From cddb1a15d4789ebc08ac4dfc73f1ebffe8fce836 Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Wed, 23 Mar 2005 00:43:36 +0000 Subject: Array quoting (not completely working.) --- sandbox/array.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sandbox/array.py (limited to 'sandbox/array.py') 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] + -- cgit v1.2.1