From: Mike Bayer Date: Tue, 10 Mar 2015 19:05:27 +0000 (-0400) Subject: - changelog and docs for pullreq bitbucket:45 X-Git-Tag: rel_1_0_0b1~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d1206c10a96b6685e57baa9ae09f04f00cf425b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - changelog and docs for pullreq bitbucket:45 --- diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index baa8bb3d21..7c487fc1b4 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -14,6 +14,18 @@ .. changelog:: :version: 0.9.9 + .. change:: + :tags: feature, postgresql + :pullreq: bitbucket:45 + + Added support for the ``CONCURRENTLY`` keyword with Postgresql + indexes, established using ``postgresql_concurrently``. Pull + request courtesy Iuri de Silvio. + + .. seealso:: + + :ref:`postgresql_index_concurrently` + .. change:: :tags: bug, ext, py3k :pullreq: github:154 diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index c819f36c3d..5899bb4118 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -402,6 +402,24 @@ underlying CREATE INDEX command, so it *must* be a valid index type for your version of PostgreSQL. +.. _postgresql_index_concurrently: + +Indexes with CONCURRENTLY +^^^^^^^^^^^^^^^^^^^^^^^^^ + +The Postgresql index option CONCURRENTLY is supported by passing the +flag ``postgresql_concurrently`` to the :class:`.Index` construct:: + + tbl = Table('testtbl', m, Column('data', Integer)) + + idx1 = Index('test_idx1', tbl.c.data, postgresql_concurrently=True) + +The above index construct will render SQL as:: + + CREATE INDEX CONCURRENTLY test_idx1 ON testtbl (data) + +.. versionadded:: 0.9.9 + .. _postgresql_index_reflection: Postgresql Index Reflection