summaryrefslogtreecommitdiff
path: root/test/dialect/test_postgresql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-01-02 11:26:37 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-01-02 11:26:37 -0500
commita94f2f81afc859ea4553037cc12734311c8328b0 (patch)
tree20f43cedbe6968e86d296910f879df6b5cc8ccc5 /test/dialect/test_postgresql.py
parent14528afd6f080cf18028f7f71992ef5c14437907 (diff)
downloadsqlalchemy-a94f2f81afc859ea4553037cc12734311c8328b0.tar.gz
Fixed bug in :func:`.postgresql.array` construct whereby using it
inside of an :func:`.expression.insert` construct would produce an error regarding a parameter issue in the ``self_group()`` method.
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r--test/dialect/test_postgresql.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py
index 38a1d51a3..4a506d544 100644
--- a/test/dialect/test_postgresql.py
+++ b/test/dialect/test_postgresql.py
@@ -319,6 +319,15 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
'param_3': 3, 'param_2': 2}
)
+ def test_array_literal_insert(self):
+ m = MetaData()
+ t = Table('t', m, Column('data', postgresql.ARRAY(Integer)))
+ self.assert_compile(
+ t.insert().values(data=array([1, 2, 3])),
+ "INSERT INTO t (data) VALUES (ARRAY[%(param_1)s, "
+ "%(param_2)s, %(param_3)s])"
+ )
+
def test_update_array_element(self):
m = MetaData()
t = Table('t', m, Column('data', postgresql.ARRAY(Integer)))