diff options
author | Malik Diarra <malik.diarra@gmail.com> | 2014-08-17 00:39:36 +0200 |
---|---|---|
committer | Malik Diarra <malik.diarra@gmail.com> | 2014-08-17 01:56:02 +0200 |
commit | d6873904c40134df787ffe5459d61d3663bf5d5f (patch) | |
tree | 12f24e9447ae25d48490d94d42b0cd5224faf5d8 /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | ef6042ff461e490c2a3040f18f0a3688b2e601a0 (diff) | |
download | sqlalchemy-d6873904c40134df787ffe5459d61d3663bf5d5f.tar.gz |
Adding oids and on_commit table options
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 0f008642e..9b30bf894 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1450,6 +1450,14 @@ class PGDDLCompiler(compiler.DDLCompiler): def post_create_table(self, table): table_opts = [] + if table.dialect_options['postgresql']['withoids'] is not None: + if table.dialect_options['postgresql']['withoids']: + table_opts.append('WITH OIDS') + else: + table_opts.append('WITHOUT OIDS') + if table.dialect_options['postgresql']['on_commit']: + on_commit_options = table.dialect_options['postgresql']['on_commit'].replace("_", " ").upper() + table_opts.append('ON COMMIT %s' % on_commit_options) if table.dialect_options['postgresql']['tablespace']: table_opts.append('TABLESPACE %s' % table.dialect_options['postgresql']['tablespace']) @@ -1715,7 +1723,9 @@ class PGDialect(default.DefaultDialect): }), (schema.Table, { "ignore_search_path": False, - "tablespace": None + "tablespace": None, + "withoids" : None, + "on_commit" : None, }) ] |