summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/postgres.py
diff options
context:
space:
mode:
authorMichael Trier <mtrier@gmail.com>2008-10-20 15:21:00 +0000
committerMichael Trier <mtrier@gmail.com>2008-10-20 15:21:00 +0000
commitc81c7ff3d59469cf6ceccbcf1593fd0563f0eaf3 (patch)
treed12139bc6c793c7190c3fb1d344a49c37080d635 /lib/sqlalchemy/databases/postgres.py
parentabcb5605f91ef206dd5f0f6400302f0b28425365 (diff)
downloadsqlalchemy-c81c7ff3d59469cf6ceccbcf1593fd0563f0eaf3.tar.gz
Modifications to allow the backends to control the behavior of an empty insert. If supports_empty_insert is True then the backend specifically supports the 'insert into t1 () values ()' syntax. If supports_default_values is True then the backend supports the 'insert into t1 default values' syntax. If both are false then the backend has no support for empty inserts at all and an exception gets raised. Changes here are careful to not change current behavior except where the current behavior was failing to begin with.
Diffstat (limited to 'lib/sqlalchemy/databases/postgres.py')
-rw-r--r--lib/sqlalchemy/databases/postgres.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index 1c410af53..c8abeb6db 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -302,6 +302,8 @@ class PGDialect(default.DefaultDialect):
preexecute_pk_sequences = True
supports_pk_autoincrement = False
default_paramstyle = 'pyformat'
+ supports_default_values = True
+ supports_empty_insert = False
def __init__(self, server_side_cursors=False, **kwargs):
default.DefaultDialect.__init__(self, **kwargs)