From d6b9757778edea97bdbda5c98eb61b37d93296cc Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 26 May 2009 01:00:46 +0000 Subject: - added unit test for exception formatting - Deprecated the hardcoded TIMESTAMP function, which when used as func.TIMESTAMP(value) would render "TIMESTAMP value". This breaks on some platforms as Postgres doesn't allow bind parameters to be used in this context. The hard-coded uppercase is also inappropriate and there's lots of other PG casts that we'd need to support. So instead, use text constructs i.e. select(["timestamp '12/05/09'"]). --- lib/sqlalchemy/databases/postgres.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/sqlalchemy/databases/postgres.py') diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 068afaf3d..4fc79921b 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -706,7 +706,6 @@ class PGDialect(default.DefaultDialect): return domains - class PGCompiler(compiler.DefaultCompiler): operators = compiler.DefaultCompiler.operators.copy() operators.update( @@ -721,7 +720,7 @@ class PGCompiler(compiler.DefaultCompiler): functions = compiler.DefaultCompiler.functions.copy() functions.update ( { - 'TIMESTAMP':lambda x:'TIMESTAMP %s' % x, + 'TIMESTAMP':util.deprecated(message="Use a literal string 'timestamp ' instead")(lambda x:'TIMESTAMP %s' % x), } ) -- cgit v1.2.1