Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
‹EYcg@sfdZddlmZddlZddlZddlmZmZm	Z	m
Z
ddlmZm
Z
ddlmZmZmZmZddlmZydd	lmZWnek
rÅeZnXdd
lmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$e%ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpgfƒZ&dqdrfZ'dsdtdudvfZ(dwdxdydzd{d|d}fZ)d~ej*fd„ƒYZ+d€ej,fd„ƒYZ-d‚ej.fdƒ„ƒYZ/e/Z0d„ej.fd…„ƒYZ1e1Z2d†ej.fd‡„ƒYZ3e3Z4dˆej.fd‰„ƒYZ5dŠej6fd‹„ƒYZ6dŒej7fd„ƒYZ7dŽej.fd„ƒYZ8e8Z9dej.fd‘„ƒYZ:e:Z;d’ej.fd“„ƒYZeZ<d”ej.fd•„ƒYZ=d–ej>fd—„ƒYZ?d˜ej>fd™„ƒYZ@dšej>fd›„ƒYZAdejBfdœ„ƒYZCdejDej.fdž„ƒYZEeEZFdŸejGfd „ƒYZHie8ejI6eHejG6ZJi ed¡6ed¢6ed£6ed¤6ed¥6ejKd¦6ejKd§6ed¨6e!d©6e dª6e$d«6e/d¬6e1d­6ed®6e:d¯6e:d°6e3d±6e5d²6e-d³6e6d´6e6dµ6e6d¶6e7d·6e7d¸6e"d¹6e7dº6e+d»6e#d¼6e8d½6e8d¾6e8d¿6e=dÀ6ZLdÁejMfd„ƒYZNdÃejOfdĄƒYZPdÅejQfdƄƒYZRdÇejSfdȄƒYZTdÉe
jUfdʄƒYZVdËejWfd̄ƒYZXdÍejWfd΄ƒYZYdÏejZfdЄƒYZ[dÑej\fd҄ƒYZ]dS(Ós7U
.. dialect:: postgresql
    :name: PostgreSQL


Sequences/SERIAL
----------------

PostgreSQL supports sequences, and SQLAlchemy uses these as the default means
of creating new primary key values for integer-based primary key columns. When
creating tables, SQLAlchemy will issue the ``SERIAL`` datatype for
integer-based primary key columns, which generates a sequence and server side
default corresponding to the column.

To specify a specific named sequence to be used for primary key generation,
use the :func:`~sqlalchemy.schema.Sequence` construct::

    Table('sometable', metadata,
            Column('id', Integer, Sequence('some_id_seq'), primary_key=True)
        )

When SQLAlchemy issues a single INSERT statement, to fulfill the contract of
having the "last insert identifier" available, a RETURNING clause is added to
the INSERT statement which specifies the primary key columns should be
returned after the statement completes. The RETURNING functionality only takes
place if Postgresql 8.2 or later is in use. As a fallback approach, the
sequence, whether specified explicitly or implicitly via ``SERIAL``, is
executed independently beforehand, the returned value to be used in the
subsequent insert. Note that when an
:func:`~sqlalchemy.sql.expression.insert()` construct is executed using
"executemany" semantics, the "last inserted identifier" functionality does not
apply; no RETURNING clause is emitted nor is the sequence pre-executed in this
case.

To force the usage of RETURNING by default off, specify the flag
``implicit_returning=False`` to :func:`.create_engine`.

.. _postgresql_isolation_level:

Transaction Isolation Level
---------------------------

All Postgresql dialects support setting of transaction isolation level
both via a dialect-specific parameter :paramref:`.create_engine.isolation_level`
accepted by :func:`.create_engine`,
as well as the :paramref:`.Connection.execution_options.isolation_level` argument as passed to
:meth:`.Connection.execution_options`.  When using a non-psycopg2 dialect,
this feature works by issuing the command
``SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL <level>`` for
each new connection.  For the special AUTOCOMMIT isolation level, DBAPI-specific
techniques are used.

To set isolation level using :func:`.create_engine`::

    engine = create_engine(
        "postgresql+pg8000://scott:tiger@localhost/test",
        isolation_level="READ UNCOMMITTED"
    )

To set using per-connection execution options::

    connection = engine.connect()
    connection = connection.execution_options(
        isolation_level="READ COMMITTED"
    )

Valid values for ``isolation_level`` include:

* ``READ COMMITTED``
* ``READ UNCOMMITTED``
* ``REPEATABLE READ``
* ``SERIALIZABLE``
* ``AUTOCOMMIT`` - on psycopg2 / pg8000 only

.. seealso::

    :ref:`psycopg2_isolation_level`

    :ref:`pg8000_isolation_level`

.. _postgresql_schema_reflection:

Remote-Schema Table Introspection and Postgresql search_path
------------------------------------------------------------

The Postgresql dialect can reflect tables from any schema.  The
:paramref:`.Table.schema` argument, or alternatively the
:paramref:`.MetaData.reflect.schema` argument determines which schema will
be searched for the table or tables.   The reflected :class:`.Table` objects
will in all cases retain this ``.schema`` attribute as was specified.
However, with regards to tables which these :class:`.Table` objects refer to
via foreign key constraint, a decision must be made as to how the ``.schema``
is represented in those remote tables, in the case where that remote
schema name is also a member of the current
`Postgresql search path
<http://www.postgresql.org/docs/current/static/ddl-schemas.html#DDL-SCHEMAS-PATH>`_.

By default, the Postgresql dialect mimics the behavior encouraged by
Postgresql's own ``pg_get_constraintdef()`` builtin procedure.  This function
returns a sample definition for a particular foreign key constraint,
omitting the referenced schema name from that definition when the name is
also in the Postgresql schema search path.  The interaction below
illustrates this behavior::

    test=> CREATE TABLE test_schema.referred(id INTEGER PRIMARY KEY);
    CREATE TABLE
    test=> CREATE TABLE referring(
    test(>         id INTEGER PRIMARY KEY,
    test(>         referred_id INTEGER REFERENCES test_schema.referred(id));
    CREATE TABLE
    test=> SET search_path TO public, test_schema;
    test=> SELECT pg_catalog.pg_get_constraintdef(r.oid, true) FROM
    test-> pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n
    test-> ON n.oid = c.relnamespace
    test-> JOIN pg_catalog.pg_constraint r  ON c.oid = r.conrelid
    test-> WHERE c.relname='referring' AND r.contype = 'f'
    test-> ;
                   pg_get_constraintdef
    ---------------------------------------------------
     FOREIGN KEY (referred_id) REFERENCES referred(id)
    (1 row)

Above, we created a table ``referred`` as a member of the remote schema
``test_schema``, however when we added ``test_schema`` to the
PG ``search_path`` and then asked ``pg_get_constraintdef()`` for the
``FOREIGN KEY`` syntax, ``test_schema`` was not included in the output of
the function.

On the other hand, if we set the search path back to the typical default
of ``public``::

    test=> SET search_path TO public;
    SET

The same query against ``pg_get_constraintdef()`` now returns the fully
schema-qualified name for us::

    test=> SELECT pg_catalog.pg_get_constraintdef(r.oid, true) FROM
    test-> pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n
    test-> ON n.oid = c.relnamespace
    test-> JOIN pg_catalog.pg_constraint r  ON c.oid = r.conrelid
    test-> WHERE c.relname='referring' AND r.contype = 'f';
                         pg_get_constraintdef
    ---------------------------------------------------------------
     FOREIGN KEY (referred_id) REFERENCES test_schema.referred(id)
    (1 row)

SQLAlchemy will by default use the return value of ``pg_get_constraintdef()``
in order to determine the remote schema name.  That is, if our ``search_path``
were set to include ``test_schema``, and we invoked a table
reflection process as follows::

    >>> from sqlalchemy import Table, MetaData, create_engine
    >>> engine = create_engine("postgresql://scott:tiger@localhost/test")
    >>> with engine.connect() as conn:
    ...     conn.execute("SET search_path TO test_schema, public")
    ...     meta = MetaData()
    ...     referring = Table('referring', meta,
    ...                       autoload=True, autoload_with=conn)
    ...
    <sqlalchemy.engine.result.ResultProxy object at 0x101612ed0>

The above process would deliver to the :attr:`.MetaData.tables` collection
``referred`` table named **without** the schema::

    >>> meta.tables['referred'].schema is None
    True

To alter the behavior of reflection such that the referred schema is
maintained regardless of the ``search_path`` setting, use the
``postgresql_ignore_search_path`` option, which can be specified as a
dialect-specific argument to both :class:`.Table` as well as
:meth:`.MetaData.reflect`::

    >>> with engine.connect() as conn:
    ...     conn.execute("SET search_path TO test_schema, public")
    ...     meta = MetaData()
    ...     referring = Table('referring', meta, autoload=True,
    ...                       autoload_with=conn,
    ...                       postgresql_ignore_search_path=True)
    ...
    <sqlalchemy.engine.result.ResultProxy object at 0x1016126d0>

We will now have ``test_schema.referred`` stored as schema-qualified::

    >>> meta.tables['test_schema.referred'].schema
    'test_schema'

.. sidebar:: Best Practices for Postgresql Schema reflection

    The description of Postgresql schema reflection behavior is complex, and
    is the product of many years of dealing with widely varied use cases and
    user preferences. But in fact, there's no need to understand any of it if
    you just stick to the simplest use pattern: leave the ``search_path`` set
    to its default of ``public`` only, never refer to the name ``public`` as
    an explicit schema name otherwise, and refer to all other schema names
    explicitly when building up a :class:`.Table` object.  The options
    described here are only for those users who can't, or prefer not to, stay
    within these guidelines.

Note that **in all cases**, the "default" schema is always reflected as
``None``. The "default" schema on Postgresql is that which is returned by the
Postgresql ``current_schema()`` function.  On a typical Postgresql
installation, this is the name ``public``.  So a table that refers to another
which is in the ``public`` (i.e. default) schema will always have the
``.schema`` attribute set to ``None``.

.. versionadded:: 0.9.2 Added the ``postgresql_ignore_search_path``
   dialect-level option accepted by :class:`.Table` and
   :meth:`.MetaData.reflect`.


.. seealso::

        `The Schema Search Path
        <http://www.postgresql.org/docs/9.0/static/ddl-schemas.html#DDL-SCHEMAS-PATH>`_
        - on the Postgresql website.

INSERT/UPDATE...RETURNING
-------------------------

The dialect supports PG 8.2's ``INSERT..RETURNING``, ``UPDATE..RETURNING`` and
``DELETE..RETURNING`` syntaxes.   ``INSERT..RETURNING`` is used by default
for single-row INSERT statements in order to fetch newly generated
primary key identifiers.   To specify an explicit ``RETURNING`` clause,
use the :meth:`._UpdateBase.returning` method on a per-statement basis::

    # INSERT..RETURNING
    result = table.insert().returning(table.c.col1, table.c.col2).\
        values(name='foo')
    print result.fetchall()

    # UPDATE..RETURNING
    result = table.update().returning(table.c.col1, table.c.col2).\
        where(table.c.name=='foo').values(name='bar')
    print result.fetchall()

    # DELETE..RETURNING
    result = table.delete().returning(table.c.col1, table.c.col2).\
        where(table.c.name=='foo')
    print result.fetchall()

.. _postgresql_match:

Full Text Search
----------------

SQLAlchemy makes available the Postgresql ``@@`` operator via the
:meth:`.ColumnElement.match` method on any textual column expression.
On a Postgresql dialect, an expression like the following::

    select([sometable.c.text.match("search string")])

will emit to the database::

    SELECT text @@ to_tsquery('search string') FROM table

The Postgresql text search functions such as ``to_tsquery()``
and ``to_tsvector()`` are available
explicitly using the standard :data:`.func` construct.  For example::

    select([
        func.to_tsvector('fat cats ate rats').match('cat & rat')
    ])

Emits the equivalent of::

    SELECT to_tsvector('fat cats ate rats') @@ to_tsquery('cat & rat')

The :class:`.postgresql.TSVECTOR` type can provide for explicit CAST::

    from sqlalchemy.dialects.postgresql import TSVECTOR
    from sqlalchemy import select, cast
    select([cast("some text", TSVECTOR)])

produces a statement equivalent to::

    SELECT CAST('some text' AS TSVECTOR) AS anon_1

Full Text Searches in Postgresql are influenced by a combination of: the
PostgresSQL setting of ``default_text_search_config``, the ``regconfig`` used
to build the GIN/GiST indexes, and the ``regconfig`` optionally passed in
during a query.

When performing a Full Text Search against a column that has a GIN or
GiST index that is already pre-computed (which is common on full text
searches) one may need to explicitly pass in a particular PostgresSQL
``regconfig`` value to ensure the query-planner utilizes the index and does
not re-compute the column on demand.

In order to provide for this explicit query planning, or to use different
search strategies, the ``match`` method accepts a ``postgresql_regconfig``
keyword argument::

    select([mytable.c.id]).where(
        mytable.c.title.match('somestring', postgresql_regconfig='english')
    )

Emits the equivalent of::

    SELECT mytable.id FROM mytable
    WHERE mytable.title @@ to_tsquery('english', 'somestring')

One can also specifically pass in a `'regconfig'` value to the
``to_tsvector()`` command as the initial argument::

    select([mytable.c.id]).where(
            func.to_tsvector('english', mytable.c.title )\
            .match('somestring', postgresql_regconfig='english')
        )

produces a statement equivalent to::

    SELECT mytable.id FROM mytable
    WHERE to_tsvector('english', mytable.title) @@
        to_tsquery('english', 'somestring')

It is recommended that you use the ``EXPLAIN ANALYZE...`` tool from
PostgresSQL to ensure that you are generating queries with SQLAlchemy that
take full advantage of any indexes you may have created for full text search.

FROM ONLY ...
------------------------

The dialect supports PostgreSQL's ONLY keyword for targeting only a particular
table in an inheritance hierarchy. This can be used to produce the
``SELECT ... FROM ONLY``, ``UPDATE ONLY ...``, and ``DELETE FROM ONLY ...``
syntaxes. It uses SQLAlchemy's hints mechanism::

    # SELECT ... FROM ONLY ...
    result = table.select().with_hint(table, 'ONLY', 'postgresql')
    print result.fetchall()

    # UPDATE ONLY ...
    table.update(values=dict(foo='bar')).with_hint('ONLY',
                                                   dialect_name='postgresql')

    # DELETE FROM ONLY ...
    table.delete().with_hint('ONLY', dialect_name='postgresql')

.. _postgresql_indexes:

Postgresql-Specific Index Options
---------------------------------

Several extensions to the :class:`.Index` construct are available, specific
to the PostgreSQL dialect.

Partial Indexes
^^^^^^^^^^^^^^^^

Partial indexes add criterion to the index definition so that the index is
applied to a subset of rows.   These can be specified on :class:`.Index`
using the ``postgresql_where`` keyword argument::

  Index('my_index', my_table.c.id, postgresql_where=my_table.c.value > 10)

Operator Classes
^^^^^^^^^^^^^^^^^

PostgreSQL allows the specification of an *operator class* for each column of
an index (see
http://www.postgresql.org/docs/8.3/interactive/indexes-opclass.html).
The :class:`.Index` construct allows these to be specified via the
``postgresql_ops`` keyword argument::

    Index('my_index', my_table.c.id, my_table.c.data,
                            postgresql_ops={
                                'data': 'text_pattern_ops',
                                'id': 'int4_ops'
                            })

.. versionadded:: 0.7.2
    ``postgresql_ops`` keyword argument to :class:`.Index` construct.

Note that the keys in the ``postgresql_ops`` dictionary are the "key" name of
the :class:`.Column`, i.e. the name used to access it from the ``.c``
collection of :class:`.Table`, which can be configured to be different than
the actual name of the column as expressed in the database.

Index Types
^^^^^^^^^^^^

PostgreSQL provides several index types: B-Tree, Hash, GiST, and GIN, as well
as the ability for users to create their own (see
http://www.postgresql.org/docs/8.3/static/indexes-types.html). These can be
specified on :class:`.Index` using the ``postgresql_using`` keyword argument::

    Index('my_index', my_table.c.data, postgresql_using='gin')

The value passed to the keyword argument will be simply passed through to the
underlying CREATE INDEX command, so it *must* be a valid index type for your
version of PostgreSQL.

.. _postgresql_index_storage:

Index Storage Parameters
^^^^^^^^^^^^^^^^^^^^^^^^

PostgreSQL allows storage parameters to be set on indexes. The storage
parameters available depend on the index method used by the index. Storage
parameters can be specified on :class:`.Index` using the ``postgresql_with``
keyword argument::

    Index('my_index', my_table.c.data, postgresql_with={"fillfactor": 50})

.. versionadded:: 1.0.6

.. _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

When using CONCURRENTLY, the Postgresql database requires that the statement
be invoked outside of a transaction block.   The Python DBAPI enforces that
even for a single statement, a transaction is present, so to use this
construct, the DBAPI's "autocommit" mode must be used::

    metadata = MetaData()
    table = Table(
        "foo", metadata,
        Column("id", String))
    index = Index(
        "foo_idx", table.c.id, postgresql_concurrently=True)

    with engine.connect() as conn:
        with conn.execution_options(isolation_level='AUTOCOMMIT'):
            table.create(conn)

.. seealso::

    :ref:`postgresql_isolation_level`

.. _postgresql_index_reflection:

Postgresql Index Reflection
---------------------------

The Postgresql database creates a UNIQUE INDEX implicitly whenever the
UNIQUE CONSTRAINT construct is used.   When inspecting a table using
:class:`.Inspector`, the :meth:`.Inspector.get_indexes`
and the :meth:`.Inspector.get_unique_constraints` will report on these
two constructs distinctly; in the case of the index, the key
``duplicates_constraint`` will be present in the index entry if it is
detected as mirroring a constraint.   When performing reflection using
``Table(..., autoload=True)``, the UNIQUE INDEX is **not** returned
in :attr:`.Table.indexes` when it is detected as mirroring a
:class:`.UniqueConstraint` in the :attr:`.Table.constraints` collection.

.. versionchanged:: 1.0.0 - :class:`.Table` reflection now includes
   :class:`.UniqueConstraint` objects present in the :attr:`.Table.constraints`
   collection; the Postgresql backend will no longer include a "mirrored"
   :class:`.Index` construct in :attr:`.Table.indexes` if it is detected
   as corresponding to a unique constraint.

Special Reflection Options
--------------------------

The :class:`.Inspector` used for the Postgresql backend is an instance
of :class:`.PGInspector`, which offers additional methods::

    from sqlalchemy import create_engine, inspect

    engine = create_engine("postgresql+psycopg2://localhost/test")
    insp = inspect(engine)  # will be a PGInspector

    print(insp.get_enums())

.. autoclass:: PGInspector
    :members:

.. _postgresql_table_options:

PostgreSQL Table Options
-------------------------

Several options for CREATE TABLE are supported directly by the PostgreSQL
dialect in conjunction with the :class:`.Table` construct:

* ``TABLESPACE``::

    Table("some_table", metadata, ..., postgresql_tablespace='some_tablespace')

* ``ON COMMIT``::

    Table("some_table", metadata, ..., postgresql_on_commit='PRESERVE ROWS')

* ``WITH OIDS``::

    Table("some_table", metadata, ..., postgresql_with_oids=True)

* ``WITHOUT OIDS``::

    Table("some_table", metadata, ..., postgresql_with_oids=False)

* ``INHERITS``::

    Table("some_table", metadata, ..., postgresql_inherits="some_supertable")

    Table("some_table", metadata, ..., postgresql_inherits=("t1", "t2", ...))

.. versionadded:: 1.0.0

.. seealso::

    `Postgresql CREATE TABLE options
    <http://www.postgresql.org/docs/current/static/sql-createtable.html>`_

ENUM Types
----------

Postgresql has an independently creatable TYPE structure which is used
to implement an enumerated type.   This approach introduces significant
complexity on the SQLAlchemy side in terms of when this type should be
CREATED and DROPPED.   The type object is also an independently reflectable
entity.   The following sections should be consulted:

* :class:`.postgresql.ENUM` - DDL and typing support for ENUM.

* :meth:`.PGInspector.get_enums` - retrieve a listing of current ENUM types

* :meth:`.postgresql.ENUM.create` , :meth:`.postgresql.ENUM.drop` - individual
  CREATE and DROP commands for ENUM.

.. _postgresql_array_of_enum:

Using ENUM with ARRAY
^^^^^^^^^^^^^^^^^^^^^

The combination of ENUM and ARRAY is not directly supported by backend
DBAPIs at this time.   In order to send and receive an ARRAY of ENUM,
use the following workaround type::

    class ArrayOfEnum(ARRAY):

        def bind_expression(self, bindvalue):
            return sa.cast(bindvalue, self)

        def result_processor(self, dialect, coltype):
            super_rp = super(ArrayOfEnum, self).result_processor(
                dialect, coltype)

            def handle_raw_string(value):
                inner = re.match(r"^{(.*)}$", value).group(1)
                return inner.split(",") if inner else []

            def process(value):
                if value is None:
                    return None
                return super_rp(handle_raw_string(value))
            return process

E.g.::

    Table(
        'mydata', metadata,
        Column('id', Integer, primary_key=True),
        Column('data', ArrayOfEnum(ENUM('a', 'b, 'c', name='myenum')))

    )

This type is not included as a built-in type as it would be incompatible
with a DBAPI that suddenly decides to support ARRAY of ENUM directly in
a new version.

.. _postgresql_array_of_json:

Using JSON/JSONB with ARRAY
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Similar to using ENUM, for an ARRAY of JSON/JSONB we need to render the
appropriate CAST, however current psycopg2 drivers seem to handle the result
for ARRAY of JSON automatically, so the type is simpler::


    class CastingArray(ARRAY):
        def bind_expression(self, bindvalue):
            return sa.cast(bindvalue, self)

E.g.::

    Table(
        'mydata', metadata,
        Column('id', Integer, primary_key=True),
        Column('data', CastingArray(JSONB))
    )


iÿÿÿÿ(tdefaultdictNi(tsqltschematexctutil(tdefaultt
reflection(tcompilert
expressiont	operatorstdefault_comparator(ttypes(tUUID(tINTEGERtBIGINTtSMALLINTtVARCHARtCHARtTEXTtFLOATtNUMERICtDATEtBOOLEANtREALtalltanalysetanalyzetandtanytarraytastasct
asymmetrictbothtcasetcasttchecktcollatetcolumnt
constrainttcreatetcurrent_catalogtcurrent_datetcurrent_roletcurrent_timetcurrent_timestamptcurrent_userRt
deferrabletdesctdistincttdotelsetendtexcepttfalsetfetchtfortforeigntfromtgranttgroupthavingtint	initiallyt	intersecttintotleadingtlimitt	localtimetlocaltimestamptnewtnottnulltoftofftoffsettoldtontonlytortordertplacingtprimaryt
referencest	returningtselecttsession_usertsomet	symmetricttabletthenttottrailingttruetuniontuniquetusertusingtvariadictwhentwheretwindowtwitht
authorizationtbetweentbinarytcrosstcurrent_schematfreezetfulltiliketinnertistisnulltjointlefttliketnaturaltnotnulltoutertovertoverlapstrighttsimilartverboseiÏi¤i¼i½iýiþiiiiiíiïiøtBYTEAcBseZdZRS(R}(t__name__t
__module__t__visit_name__(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR}ŒstDOUBLE_PRECISIONcBseZdZRS(R(R~RR€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRstINETcBseZdZRS(R‚(R~RR€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR‚”stCIDRcBseZdZRS(Rƒ(R~RR€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRƒ™stMACADDRcBseZdZRS(R„(R~RR€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR„žstOIDcBseZdZdZRS(sCProvide the Postgresql OID type.

    .. versionadded:: 0.9.5

    R…(R~Rt__doc__R€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR…£st	TIMESTAMPcBseZedd„ZRS(cCs&tt|ƒjd|ƒ||_dS(Nttimezone(tsuperR‡t__init__t	precision(tselfRˆR‹((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRНsN(R~RtFalsetNoneRŠ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR‡­stTIMEcBseZedd„ZRS(cCs&tt|ƒjd|ƒ||_dS(NRˆ(R‰RRŠR‹(RŒRˆR‹((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRжsN(R~RRRŽRŠ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR´stINTERVALcBsMeZdZdZdd„Zed„ƒZed„ƒZ	ed„ƒZ
RS(s˜Postgresql INTERVAL type.

    The INTERVAL type may not be supported on all DBAPIs.
    It is known to work on psycopg2 and not pg8000 or zxjdbc.

    RcCs
||_dS(N(R‹(RŒR‹((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠÅscCstd|jƒS(NR‹(Rtsecond_precision(tclstinterval((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_adapt_from_generic_intervalÈscCstjS(N(tsqltypestInterval(RŒ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_type_affinityÌscCstjS(N(tdtt	timedelta(RŒ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytpython_typeÐsN(R~RR†R€RŽRŠtclassmethodR”tpropertyR—Rš(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR»stBITcBseZdZded„ZRS(RcCs.|s|pd|_n	||_||_dS(Ni(tlengthtvarying(RŒRžRŸ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠÚs	N(R~RR€RŽRRŠ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR×sRcBs2eZdZdZed„Zd„Zd„ZRS(s
Postgresql UUID type.

    Represents the UUID column type, interpreting
    data either as natively returned by the DBAPI
    or as Python uuid objects.

    The UUID type may not be supported on all DBAPIs.
    It is known to work on psycopg2 and not pg8000.

    RcCs.|r!tdkr!tdƒ‚n||_dS(s¸Construct a UUID type.


        :param as_uuid=False: if True, values will be interpreted
         as Python uuid objects, converting to/from string via the
         DBAPI.

         s=This version of Python does not support the native UUID type.N(t_python_UUIDRŽtNotImplementedErrortas_uuid(RŒR¢((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠôs	cCs|jrd„}|SdSdS(NcSs"|dk	rtj|ƒ}n|S(N(RŽRt	text_type(tvalue((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytprocesss(R¢RŽ(RŒtdialectR¥((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytbind_processors		cCs|jrd„}|SdSdS(NcSs|dk	rt|ƒ}n|S(N(RŽR (R¤((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR¥s(R¢RŽ(RŒR¦tcoltypeR¥((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytresult_processors		(R~RR†R€RRŠR§R©(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRæs
	
tTSVECTORcBseZdZdZRS(sThe :class:`.postgresql.TSVECTOR` type implements the Postgresql
    text search type TSVECTOR.

    It can be used to do full text queries on natural language
    documents.

    .. versionadded:: 0.9.0

    .. seealso::

        :ref:`postgresql_match`

    Rª(R~RR†R€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRªst_SlicecBs eZdZejZd„ZRS(tslicecCsFtj|jtj|jƒ|_tj|jtj|jƒ|_dS(N(R
t_check_literaltexprR	tgetitemtstarttstop(RŒtslice_tsource_comparator((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠ1s(R~RR€R•tNULLTYPEttypeRŠ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR«-s	tAnycBs#eZdZdZejd„ZRS(sâRepresent the clause ``left operator ANY (right)``.  ``right`` must be
    an array expression.

    .. seealso::

        :class:`.postgresql.ARRAY`

        :meth:`.postgresql.ARRAY.Comparator.any` - ARRAY-bound method

    RcCs7tjƒ|_tj|ƒ|_||_||_dS(N(R•tBooleanRµRt_literal_as_bindsRsRztoperator(RŒRsRzR¹((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠHs	(R~RR†R€R	teqRŠ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR¶:stAllcBs#eZdZdZejd„ZRS(sâRepresent the clause ``left operator ALL (right)``.  ``right`` must be
    an array expression.

    .. seealso::

        :class:`.postgresql.ARRAY`

        :meth:`.postgresql.ARRAY.Comparator.all` - ARRAY-bound method

    RcCs7tjƒ|_tj|ƒ|_||_||_dS(N(R•R·RµRR¸RsRzR¹(RŒRsRzR¹((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠ]s	(R~RR†R€R	RºRŠ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR»OscBs2eZdZdZd„Zd„Zdd„ZRS(sªA Postgresql ARRAY literal.

    This is used to produce ARRAY literals in SQL expressions, e.g.::

        from sqlalchemy.dialects.postgresql import array
        from sqlalchemy.dialects import postgresql
        from sqlalchemy import select, func

        stmt = select([
                        array([1,2]) + array([3,4,5])
                    ])

        print stmt.compile(dialect=postgresql.dialect())

    Produces the SQL::

        SELECT ARRAY[%(param_1)s, %(param_2)s] ||
            ARRAY[%(param_3)s, %(param_4)s, %(param_5)s]) AS anon_1

    An instance of :class:`.array` will always have the datatype
    :class:`.ARRAY`.  The "inner" type of the array is inferred from
    the values present, unless the ``type_`` keyword argument is passed::

        array(['foo', 'bar'], type_=CHAR)

    .. versionadded:: 0.8 Added the :class:`~.postgresql.array` literal type.

    See also:

    :class:`.postgresql.ARRAY`

    RcKs/tt|ƒj||Žt|jƒ|_dS(N(R‰RRŠtARRAYRµ(RŒtclausestkw((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠˆscCs>tg|D]-}tjd|d|d|jdtƒ^q
ƒS(Nt_compared_to_operatort_compared_to_typeR_(RRt
BindParameterRŽRµtTrue(RŒR¹tobjto((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_bind_paramŒscCs|S(N((RŒtagainst((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
self_group“sN(R~RR†R€RŠRÅRŽRÇ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRds
!		R¼cBs{eZdZdZdejjfd„ƒYZeZed
ed„Z
ed„ƒZd„Z
d„Zd„Zd	„ZRS(sPostgresql ARRAY type.

    Represents values as Python lists.

    An :class:`.ARRAY` type is constructed given the "type"
    of element::

        mytable = Table("mytable", metadata,
                Column("data", ARRAY(Integer))
            )

    The above type represents an N-dimensional array,
    meaning Postgresql will interpret values with any number
    of dimensions automatically.   To produce an INSERT
    construct that passes in a 1-dimensional array of integers::

        connection.execute(
                mytable.insert(),
                data=[1,2,3]
        )

    The :class:`.ARRAY` type can be constructed given a fixed number
    of dimensions::

        mytable = Table("mytable", metadata,
                Column("data", ARRAY(Integer, dimensions=2))
            )

    This has the effect of the :class:`.ARRAY` type
    specifying that number of bracketed blocks when a :class:`.Table`
    is used in a CREATE TABLE statement, or when the type is used
    within a :func:`.expression.cast` construct; it also causes
    the bind parameter and result set processing of the type
    to optimize itself to expect exactly that number of dimensions.
    Note that Postgresql itself still allows N dimensions with such a type.

    SQL expressions of type :class:`.ARRAY` have support for "index" and
    "slice" behavior.  The Python ``[]`` operator works normally here, given
    integer indexes or slices.  Note that Postgresql arrays default
    to 1-based indexing.  The operator produces binary expression
    constructs which will produce the appropriate SQL, both for
    SELECT statements::

        select([mytable.c.data[5], mytable.c.data[2:7]])

    as well as UPDATE statements when the :meth:`.Update.values` method
    is used::

        mytable.update().values({
            mytable.c.data[5]: 7,
            mytable.c.data[2:7]: [1, 2, 3]
        })

    .. note::

        Multi-dimensional support for the ``[]`` operator is not supported
        in SQLAlchemy 1.0.  Please use the :func:`.type_coerce` function
        to cast an intermediary expression to ARRAY again as a workaround::

            expr = type_coerce(my_array_column[5], ARRAY(Integer))[6]

        Multi-dimensional support will be provided in a future release.

    :class:`.ARRAY` provides special methods for containment operations,
    e.g.::

        mytable.c.data.contains([1, 2])

    For a full list of special methods see :class:`.ARRAY.Comparator`.

    .. versionadded:: 0.8 Added support for index and slice operations
       to the :class:`.ARRAY` type, including support for UPDATE
       statements, and special array containment operations.

    The :class:`.ARRAY` type may not be supported on all DBAPIs.
    It is known to work on psycopg2 and not pg8000.

    Additionally, the :class:`.ARRAY` type does not work directly in
    conjunction with the :class:`.ENUM` type.  For a workaround, see the
    special type at :ref:`postgresql_array_of_enum`.

    See also:

    :class:`.postgresql.array` - produce a literal array value.

    R¼t
ComparatorcBsYeZdZd„Zejd„Zejd„Zd„Zd„Z	d„Z
d„ZRS(s1Define comparison operations for :class:`.ARRAY`.cCs¦|jjjrdnd}t|tƒrq|rVt|j||j||jƒ}nt||ƒ}|j}n||7}|jj	}t
j|jtj
|d|ƒS(Niitresult_type(R®Rµtzero_indexest
isinstanceR¬R°R±tstepR«t	item_typeR
t_binary_operateR	R¯(RŒtindext
shift_indexestreturn_type((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt__getitem__õs


cCst||jd|ƒS(sReturn ``other operator ANY (array)`` clause.

            Argument places are switched, because ANY requires array
            expression to be on the right hand-side.

            E.g.::

                from sqlalchemy.sql import operators

                conn.execute(
                    select([table.c.data]).where(
                            table.c.data.any(7, operator=operators.lt)
                        )
                )

            :param other: expression to be compared
            :param operator: an operator object from the
             :mod:`sqlalchemy.sql.operators`
             package, defaults to :func:`.operators.eq`.

            .. seealso::

                :class:`.postgresql.Any`

                :meth:`.postgresql.ARRAY.Comparator.all`

            R¹(R¶R®(RŒtotherR¹((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRscCst||jd|ƒS(sReturn ``other operator ALL (array)`` clause.

            Argument places are switched, because ALL requires array
            expression to be on the right hand-side.

            E.g.::

                from sqlalchemy.sql import operators

                conn.execute(
                    select([table.c.data]).where(
                            table.c.data.all(7, operator=operators.lt)
                        )
                )

            :param other: expression to be compared
            :param operator: an operator object from the
             :mod:`sqlalchemy.sql.operators`
             package, defaults to :func:`.operators.eq`.

            .. seealso::

                :class:`.postgresql.All`

                :meth:`.postgresql.ARRAY.Comparator.any`

            R¹(R»R®(RŒRÓR¹((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR&scKs|jjdƒ|ƒS(sBoolean expression.  Test if elements are a superset of the
            elements of the argument array expression.
            s@>(R®top(RŒRÓtkwargs((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytcontainsDscCs|jjdƒ|ƒS(s„Boolean expression.  Test if elements are a proper subset of the
            elements of the argument array expression.
            s<@(R®RÔ(RŒRÓ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytcontained_byJscCs|jjdƒ|ƒS(suBoolean expression.  Test if array has elements in common with
            an argument array expression.
            s&&(R®RÔ(RŒRÓ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytoverlapPscCsJt|tjƒr1|jdkr1|tjfSntjjj|||ƒS(Ns@>s<@s&&(s@>s<@s&&(	RËR	t	custom_optopstringR•R·tConcatenableRÈt_adapt_expression(RŒRÔtother_comparator((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÜVs
(R~RR†RÒR	RºRRRÖR×RØRÜ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÈñs				cCsat|tƒrtdƒ‚nt|tƒr9|ƒ}n||_||_||_||_dS(sOConstruct an ARRAY.

        E.g.::

          Column('myarray', ARRAY(Integer))

        Arguments are:

        :param item_type: The data type of items of this array. Note that
          dimensionality is irrelevant here, so multi-dimensional arrays like
          ``INTEGER[][]``, are constructed as ``ARRAY(Integer)``, not as
          ``ARRAY(ARRAY(Integer))`` or such.

        :param as_tuple=False: Specify whether return results
          should be converted to tuples from lists. DBAPIs such
          as psycopg2 return lists by default. When tuples are
          returned, the results are hashable.

        :param dimensions: if non-None, the ARRAY will assume a fixed
         number of dimensions.  This will cause the DDL emitted for this
         ARRAY to include the exact number of bracket clauses ``[]``,
         and will also optimize the performance of the type overall.
         Note that PG arrays are always implicitly "non-dimensioned",
         meaning they can store any number of dimensions no matter how
         they were declared.

        :param zero_indexes=False: when True, index values will be converted
         between Python zero-based and Postgresql one-based indexes, e.g.
         a value of one will be added to all index values before passing
         to the database.

         .. versionadded:: 0.9.5

        sUDo not nest ARRAY types; ARRAY(basetype) handles multi-dimensional arrays of basetypeN(RËR¼t
ValueErrorRµRÍtas_tuplet
dimensionsRÊ(RŒRÍRßRàRÊ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠ_s$			cCstS(N(tlist(RŒ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRšscCs
||kS(N((RŒtxty((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytcompare_values‘scs¨ˆdkrt|ƒ}nˆdksTˆdkr|sTt|dttfƒrˆrtˆ‡fd†|DƒƒSˆ|ƒSn#ˆ‡‡‡‡fd†|DƒƒSdS(Niic3s|]}ˆ|ƒVqdS(N((t.0Râ(titemproc(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>sc3s=|]3}ˆj|ˆˆdk	r+ˆdndˆƒVqdS(iN(t_proc_arrayRŽ(RåRâ(t
collectiontdimRæRŒ(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>¢s(RŽRáRËttuple(RŒtarrRæRéRè((RèRéRæRŒsX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRç”s!
cs1ˆjj|ƒj|ƒ‰‡‡fd†}|S(Ncs-|dkr|Sˆj|ˆˆjtƒSdS(N(RŽRçRàRá(R¤(t	item_procRŒ(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR¥®s(RÍtdialect_implR§(RŒR¦R¥((RìRŒsX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR§©s
				cs4ˆjj|ƒj||ƒ‰‡‡fd†}|S(Ncs<|dkr|Sˆj|ˆˆjˆjr1tntƒSdS(N(RŽRçRàRßRêRá(R¤(RìRŒ(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR¥¾s(RÍRíR©(RŒR¦R¨R¥((RìRŒsX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR©¹s
			N(R~RR†R€R•RÛRÈtcomparator_factoryRRŽRŠRœRšRäRçR§R©(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR¼—sWl-			tENUMcBsbeZdZd„Zd	ed„Zd	ed„Zd„Zd„Z	d„Z
d„Zd„ZRS(
s»Postgresql ENUM type.

    This is a subclass of :class:`.types.Enum` which includes
    support for PG's ``CREATE TYPE`` and ``DROP TYPE``.

    When the builtin type :class:`.types.Enum` is used and the
    :paramref:`.Enum.native_enum` flag is left at its default of
    True, the Postgresql backend will use a :class:`.postgresql.ENUM`
    type as the implementation, so the special create/drop rules
    will be used.

    The create/drop behavior of ENUM is necessarily intricate, due to the
    awkward relationship the ENUM type has in relationship to the
    parent table, in that it may be "owned" by just a single table, or
    may be shared among many tables.

    When using :class:`.types.Enum` or :class:`.postgresql.ENUM`
    in an "inline" fashion, the ``CREATE TYPE`` and ``DROP TYPE`` is emitted
    corresponding to when the :meth:`.Table.create` and :meth:`.Table.drop`
    methods are called::

        table = Table('sometable', metadata,
            Column('some_enum', ENUM('a', 'b', 'c', name='myenum'))
        )

        table.create(engine)  # will emit CREATE ENUM and CREATE TABLE
        table.drop(engine)  # will emit DROP TABLE and DROP ENUM

    To use a common enumerated type between multiple tables, the best
    practice is to declare the :class:`.types.Enum` or
    :class:`.postgresql.ENUM` independently, and associate it with the
    :class:`.MetaData` object itself::

        my_enum = ENUM('a', 'b', 'c', name='myenum', metadata=metadata)

        t1 = Table('sometable_one', metadata,
            Column('some_enum', myenum)
        )

        t2 = Table('sometable_two', metadata,
            Column('some_enum', myenum)
        )

    When this pattern is used, care must still be taken at the level
    of individual table creates.  Emitting CREATE TABLE without also
    specifying ``checkfirst=True`` will still cause issues::

        t1.create(engine) # will fail: no such type 'myenum'

    If we specify ``checkfirst=True``, the individual table-level create
    operation will check for the ``ENUM`` and create if not exists::

        # will check if enum exists, and emit CREATE TYPE if not
        t1.create(engine, checkfirst=True)

    When using a metadata-level ENUM type, the type will always be created
    and dropped if either the metadata-wide create/drop is called::

        metadata.create_all(engine)  # will emit CREATE TYPE
        metadata.drop_all(engine)  # will emit DROP TYPE

    The type can also be created and dropped directly::

        my_enum.create(engine)
        my_enum.drop(engine)

    .. versionchanged:: 1.0.0 The Postgresql :class:`.postgresql.ENUM` type
       now behaves more strictly with regards to CREATE/DROP.  A metadata-level
       ENUM type will only be created and dropped at the metadata level,
       not the table level, with the exception of
       ``table.create(checkfirst=True)``.
       The ``table.drop()`` call will now emit a DROP TYPE for a table-level
       enumerated type.

    cOs2|jdtƒ|_tt|ƒj||ŽdS(s&Construct an :class:`~.postgresql.ENUM`.

        Arguments are the same as that of
        :class:`.types.Enum`, but also including
        the following parameters.

        :param create_type: Defaults to True.
         Indicates that ``CREATE TYPE`` should be
         emitted, after optionally checking for the
         presence of the type, when the parent
         table is being created; and additionally
         that ``DROP TYPE`` is called when the table
         is dropped.    When ``False``, no check
         will be performed and no ``CREATE TYPE``
         or ``DROP TYPE`` is emitted, unless
         :meth:`~.postgresql.ENUM.create`
         or :meth:`~.postgresql.ENUM.drop`
         are called directly.
         Setting to ``False`` is helpful
         when invoking a creation scheme to a SQL file
         without access to the actual database -
         the :meth:`~.postgresql.ENUM.create` and
         :meth:`~.postgresql.ENUM.drop` methods can
         be used to emit SQL to a target bind.

         .. versionadded:: 0.7.4

        tcreate_typeN(tpopRÂRðR‰RïRŠ(RŒtenumsR¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠscCsS|jjsdS|s9|jj||jd|jƒrO|jt|ƒƒndS(såEmit ``CREATE TYPE`` for this
        :class:`~.postgresql.ENUM`.

        If the underlying dialect does not support
        Postgresql CREATE TYPE, no action is taken.

        :param bind: a connectable :class:`.Engine`,
         :class:`.Connection`, or similar object to emit
         SQL.
        :param checkfirst: if ``True``, a query against
         the PG catalog will be first performed to see
         if the type does not exist already before
         creating.

        NR(R¦tsupports_native_enumthas_typetnameRtexecutetCreateEnumType(RŒtbindt
checkfirst((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR(:s	cCsR|jjsdS|s8|jj||jd|jƒrN|jt|ƒƒndS(sÑEmit ``DROP TYPE`` for this
        :class:`~.postgresql.ENUM`.

        If the underlying dialect does not support
        Postgresql DROP TYPE, no action is taken.

        :param bind: a connectable :class:`.Engine`,
         :class:`.Connection`, or similar object to emit
         SQL.
        :param checkfirst: if ``True``, a query against
         the PG catalog will be first performed to see
         if the type actually exists before dropping.

        NR(R¦RóRôRõRRötDropEnumType(RŒRøRù((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytdropRs
!cCs|js
tSd|kry|d}d|jkrB|jd}ntƒ}|jd<|j|k}|j|jƒ|StSdS(sLook in the 'ddl runner' for 'memos', then
        note our name in that collection.

        This to ensure a particular named enum is operated
        upon only once within any kind of create/drop
        sequence without relying upon "checkfirst".

        t_ddl_runnert	_pg_enumsN(RðRÂtmemotsetRõtaddR(RŒRùR¾t
ddl_runnertpg_enumstpresent((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_check_for_name_in_memoshs		
cKsS|s6|jrO|jdtƒrO|j||ƒrO|jd|d|ƒndS(Nt_is_metadata_operationRøRù(tmetadatatgetRRR((RŒttargetRøRùR¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_on_table_creates

cKsM|jrI|jdtƒrI|j||ƒrI|jd|d|ƒndS(NRRøRù(RRRRRû(RŒRRøRùR¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_on_table_drop†s
cKs/|j||ƒs+|jd|d|ƒndS(NRøRù(RR((RŒRRøRùR¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_on_metadata_createŒscKs/|j||ƒs+|jd|d|ƒndS(NRøRù(RRû(RŒRRøRùR¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_on_metadata_dropsN(
R~RR†RŠRŽRÂR(RûRR	R
RR(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRïÌsL	 				tintegertbiginttsmallintscharacter varyingt	characters"char"Rõttexttnumerictfloattrealtinettcidrtuuidtbitsbit varyingtmacaddrtoidsdouble precisiont	timestampstimestamp with time zonestimestamp without time zonestime with time zonestime without time zonetdatettimetbyteatbooleanR“sinterval year to monthsinterval day to secondttsvectort
PGCompilercBs˜eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„ZRS(cKsd|j||S(Ns	ARRAY[%s](tvisit_clauselist(RŒtelementR¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_array¿scKs,d|j|j||j|j|fS(Ns%s:%s(R¥R°R±(RŒR#R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_sliceÂscKs9d|j|j|tj|j|j|j|fS(Ns%s%sANY (%s)(R¥RsRt	OPERATORSR¹Rz(RŒR#R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt	visit_anyÈs
cKs9d|j|j|tj|j|j|j|fS(Ns%s%sALL (%s)(R¥RsRR&R¹Rz(RŒR#R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt	visit_allÏs
cKs,d|j|j||j|j|fS(Ns%s[%s](R¥RsRz(RŒRiR¹R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_getitem_binaryÖscKsd|jkrc|j|jdtjƒ}|rcd|j|j|||j|j|fSnd|j|j||j|j|fS(Ntpostgresql_regconfigs%s @@ to_tsquery(%s, %s)s%s @@ to_tsquery(%s)(t	modifierstrender_literal_valueR•t
STRINGTYPER¥RsRz(RŒRiR¹R¾t	regconfig((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_match_op_binaryÜs
cKsd|jjddƒ}d|j|j||j|j|f|r_d|j|tjƒndS(Ntescapes%s ILIKE %ss ESCAPE t(	R+RRŽR¥RsRzR,R•R-(RŒRiR¹R¾R0((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_ilike_op_binaryìs
cKsd|jjddƒ}d|j|j||j|j|f|r_d|j|tjƒndS(NR0s%s NOT ILIKE %ss ESCAPE R1(	R+RRŽR¥RsRzR,R•R-(RŒRiR¹R¾R0((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_notilike_op_binaryøs
cCs@tt|ƒj||ƒ}|jjr<|jddƒ}n|S(Ns\s\\(R‰R!R,R¦t_backslash_escapestreplace(RŒR¤ttype_((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR,scCsd|jj|ƒS(Ns
nextval('%s')(tpreparertformat_sequence(RŒtseq((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_sequence
scKs„d}|jdk	r5|d|j|j|7}n|jdk	r€|jdkr`|d7}n|d|j|j|7}n|S(NR1s	 
 LIMIT s 
 LIMIT ALLs OFFSET (t
_limit_clauseRŽR¥t_offset_clause(RŒRUR¾R((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytlimit_clause
s 
 cCs0|jƒdkr(tjd|ƒ‚nd|S(NtONLYsUnrecognized hint: %rsONLY (tupperRtCompileError(RŒtsqltextRYthinttiscrud((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytformat_from_hint_textscKs”|jtk	rŒ|jtkr"dSt|jttfƒrnddjg|jD]}|j|ƒ^qMƒdSd|j|j|dSndSdS(Ns	DISTINCT s
DISTINCT ON (s, s) R1(t	_distinctRRÂRËRáRêRrR¥(RŒRUR¾tcol((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_select_precolumnss4cs|jjrd}nd}|jjrstjd„|jjDƒƒ}|ddj‡‡fd†|Dƒƒ7}n|jjrŒ|d7}n|S(Ns
 FOR SHAREs FOR UPDATEcss0|]&}t|tjƒr$|jn|VqdS(N(RËRtColumnClauseRY(Råtc((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>3ss OF s, c3s-|]#}ˆj|dtdtˆVqdS(tashintt
use_schemaN(R¥RÂR(RåRY(R¾RŒ(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>6ss NOWAIT(t_for_update_argtreadRIRt
OrderedSetRrtnowait(RŒRUR¾ttmpttables((R¾RŒsX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytfor_update_clause*s	
cCsHgtj|ƒD]!}|jd|ttiƒ^q}ddj|ƒS(Ns
RETURNING s, (Rt_select_iterablest_label_select_columnRŽRÂRRr(RŒtstmttreturning_colsRItcolumns((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytreturning_clause?s4cKs|j|jjd|}|j|jjd|}t|jjƒdkr}|j|jjd|}d|||fSd||fSdS(NiiisSUBSTRING(%s FROM %s FOR %s)sSUBSTRING(%s FROM %s)(R¥R½tlen(RŒtfuncR¾tsR°Rž((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_substring_funcHs(R~RR$R%R'R(R)R/R2R3R,R:R=RDRGRRRXR\(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR!½s 											
					t
PGDDLCompilercBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cKsf|jj|ƒ}|jj|jƒ}t|tjƒrE|j}n|j	rú||j
jkrú|jjst|tj
ƒrú|jdks¯t|jtjƒrú|jjrút|tjƒrÎ|d7}qLt|tj
ƒrí|d7}qL|d7}nR|d|jjj|jd|ƒ7}|j|ƒ}|dk	rL|d|7}n|jsb|d7}n|S(Ns
 BIGSERIALs SMALLSERIALs SERIALt ttype_expressions	 DEFAULT s	 NOT NULL(R7t
format_columnRµRíR¦RËR•t
TypeDecoratortimpltprimary_keyRYt_autoincrement_columntsupports_smallserialtSmallIntegerRRŽRtSequencetoptionalt
BigIntegert
type_compilerR¥tget_column_default_stringtnullable(RŒR&RÕtcolspect	impl_typeR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_column_specificationTs0	


	
cs?|j}dˆjj|ƒdj‡fd†|jDƒƒfS(NsCREATE TYPE %s AS ENUM (%s)s, c3s0|]&}ˆjjtj|ƒdtƒVqdS(t
literal_bindsN(tsql_compilerR¥RtliteralRÂ(Råte(RŒ(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>}s(R#R7tformat_typeRrRò(RŒR(R6((RŒsX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_create_enum_typews	cCs|j}d|jj|ƒS(NsDROP TYPE %s(R#R7Rt(RŒRûR6((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_drop_enum_types	c
Cs|j}|j}|j|ƒd}|jr;|d7}n|d7}|jdd}|ri|d7}n|d|j|dtƒ|j|jƒf7}|jdd	}|rÉ|d
|j	|ƒ7}n|jdd}|dd
j
g|jD]u}|jj
t|tjƒs|jƒn|dtdtƒt|dƒr^|j|kr^d||jnd^qðƒ7}|jdd}	|	r¾|dd
j
g|	jƒD]}
d|
^q ƒ7}n|jdd}|dk	r
|jj
|dtdtƒ}|d|7}n|S(NsCREATE sUNIQUE sINDEX t
postgresqltconcurrentlys
CONCURRENTLY s	%s ON %s tinclude_schemaRas	USING %s topss(%s)s, t
include_tableRptkeyR^R1Rfs
 WITH (%s)s%s = %sRds WHERE (R7R#t_verify_index_tableR_tdialect_optionst_prepared_index_nameRtformat_tableRYtquoteRrtexpressionsRqR¥RËRRHRÇRÂthasattrR|titemsRŽ(
RŒR(R7RÏRRxRaRzR®t
withclausetstorage_parametertwhereclausetwhere_compiled((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_create_indexˆsD		
	



‡(		cKsñd}|jdk	r2|d|jj|ƒ7}ng}xJ|jD]?\}}}t|d<|jd|jj|||fƒqBW|d|j	dj
|ƒf7}|jdk	rÚ|d|jj|jdtƒ7}n||j
|ƒ7}|S(	NR1sCONSTRAINT %s R{s
%s WITH %ssEXCLUDE USING %s (%s)s, s WHERE (%s)Rp(RõRŽR7tformat_constraintt
_render_exprsRtappendRqR¥RaRrRdRÂtdefine_constraint_deferrability(RŒR'R¾RtelementsR®RõRÔ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_exclude_constraintÁs"
$	cs;g}|jd}|jdƒ}|dk	r€t|ttfƒsO|f}n|jddj‡fd†|Dƒƒdƒn|dtkr |jdƒn |dt	krÀ|jd	ƒn|d
rú|d
j
ddƒjƒ}|jd
|ƒn|dr.|d}|jdˆjj
|ƒƒndj|ƒS(NRwtinheritss

 INHERITS ( s, c3s!|]}ˆjj|ƒVqdS(N(R7R(RåRõ(RŒ(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>ßss )t	with_oidss
 WITH OIDSs
 WITHOUT OIDSt	on_committ_R^s
 ON COMMIT %st
tablespaces
 TABLESPACE %sR1(R~RRŽRËRáRêRŒRrRÂRR5R?R7R(RŒRYt
table_optstpg_optsRton_commit_optionsttablespace_name((RŒsX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytpost_create_tableÕs*
 


(R~RRoRuRvR‰RR™(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR]Rs	#	
		9	tPGTypeCompilercBseZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cKsdS(NRª((RŒRµR¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_TSVECTORõscKsdS(NR‚((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
visit_INETøscKsdS(NRƒ((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
visit_CIDRûscKsdS(NR„((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
visit_MACADDRþscKsdS(NR…((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt	visit_OIDscKs#|js
dSdi|jd6SdS(NRsFLOAT(%(precision)s)R‹(R‹(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_FLOATs	cKsdS(NsDOUBLE PRECISION((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_DOUBLE_PRECISION
scKsdS(NR((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_BIGINT
scKsdS(NtHSTORE((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_HSTOREscKsdS(NtJSON((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
visit_JSONscKsdS(NtJSONB((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_JSONBscKsdS(Nt	INT4RANGE((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_INT4RANGEscKsdS(Nt	INT8RANGE((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_INT8RANGEscKsdS(NtNUMRANGE((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_NUMRANGEscKsdS(Nt	DATERANGE((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_DATERANGE"scKsdS(NtTSRANGE((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
visit_TSRANGE%scKsdS(Nt	TSTZRANGE((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_TSTZRANGE(scKs|j||S(N(tvisit_TIMESTAMP(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_datetime+scKsD|js|jjr0tt|ƒj||S|j||SdS(N(tnative_enumR¦RóR‰Ršt
visit_enumt
visit_ENUM(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR¸.scKs|jjj|ƒS(N(R¦tidentifier_preparerRt(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR¹4scKs@dt|ddƒr"d|jp%d|jr4dp7ddfS(NsTIMESTAMP%s %sR‹s(%d)R1tWITHtWITHOUTs
 TIME ZONE(tgetattrRŽR‹Rˆ(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRµ7s
cKs@dt|ddƒr"d|jp%d|jr4dp7ddfS(Ns	TIME%s %sR‹s(%d)R1R»R¼s
 TIME ZONE(R½RŽR‹Rˆ(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
visit_TIME>s
cKs"|jdk	rd|jSdSdS(NsINTERVAL(%d)R(R‹RŽ(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_INTERVALEscKsF|jr5d}|jdk	rB|d|j7}qBn
d|j}|S(NsBIT VARYINGs(%d)sBIT(%d)(RŸRžRŽ(RŒR6R¾tcompiled((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt	visit_BITKs	
cKsdS(NR((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
visit_UUIDTscKs|j||S(N(tvisit_BYTEA(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_large_binaryWscKsdS(NR}((RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÃZscKs0|j|jƒd|jdk	r*|jndS(Ns[]i(R¥RÍRàRŽ(RŒR6R¾((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytvisit_ARRAY]s(R~RR›RœRRžRŸR R¡R¢R¤R¦R¨RªR¬R®R°R²R´R¶R¸R¹RµR¾R¿RÁRÂRÄRÃRÅ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRšôs8																												tPGIdentifierPreparercBs#eZeZd„Zed„ZRS(cCs9|d|jkr5|dd!j|j|jƒ}n|S(Niiiÿÿÿÿ(t
initial_quoteR5tescape_to_quotetescape_quote(RŒR¤((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_unquote_identifiergs
cCsm|jstjdƒ‚n|j|jƒ}|jri|ri|jdk	ri|j|jƒd|}n|S(Ns%Postgresql ENUM type requires a name.t.(RõRR@Rtomit_schemaRRŽtquote_schema(RŒR6RKRõ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRtms	(R~RtRESERVED_WORDStreserved_wordsRÊRÂRt(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÆcs	tPGInspectorcBs5eZd„Zdd„Zdd„Zdd„ZRS(cCstjj||ƒdS(N(Rt	InspectorRŠ(RŒtconn((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠyscCs"|jj|j||d|jƒS(s(Return the OID for the given table name.t
info_cache(R¦t
get_table_oidRøRÓ(RŒt
table_nameR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÔ|scCs%|p|j}|jj|j|ƒS(sKReturn a list of ENUM objects.

        Each member is a dictionary containing these fields:

            * name - name of the enum
            * schema - the schema name for the enum.
            * visible - boolean, whether or not this enum is visible
              in the default search path.
            * labels - a list of string labels that apply to the enum.

        :param schema: schema name.  If None, the default schema
         (typically 'public') is used.  May also be set to '*' to
         indicate load enums for all schemas.

        .. versionadded:: 1.0.0

        (tdefault_schema_nameR¦t_load_enumsRø(RŒR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt	get_enums‚scCs%|p|j}|jj|j|ƒS(sReturn a list of FOREIGN TABLE names.

        Behavior is similar to that of :meth:`.Inspector.get_table_names`,
        except that the list is limited to those tables tha report a
        ``relkind`` value of ``f``.

        .. versionadded:: 1.0.0

        (RÖR¦t_get_foreign_table_namesRø(RŒR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_foreign_table_names—s
N(R~RRŠRŽRÔRØRÚ(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÐws	R÷cBseZdZRS(tcreate_enum_type(R~RR€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR÷¥sRúcBseZdZRS(tdrop_enum_type(R~RR€(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRú©stPGExecutionContextcBseZd„Zd„ZRS(cCs#|jd|jjj|ƒ|ƒS(Nsselect nextval('%s')(t_execute_scalarR¦RºR8(RŒR9R6((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
fire_sequence¯scCss|jr]||jjkr]|jrM|jjrM|jd|jj|jƒS|jdkst|jj
r]|jjr]y
|j}Wn‹t
k
r|jj}|j}|ddtddt|ƒƒ!}|ddtddt|ƒƒ!}d||f}||_}nX|jj}|dk	r:d||f}n
d|f}|j||jƒSntt|ƒj|ƒS(Ns	select %siis	%s_%s_seqsselect nextval('"%s"."%s"')sselect nextval('"%s"')(RcRYRdtserver_defaultthas_argumentRÞtargRµRRŽtis_sequenceRht_postgresql_seq_nametAttributeErrorRõtmaxRYRR‰RÝtget_insert_default(RŒR&tseq_namettabRFRõtschR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRç´s4		



	$$
(R~RRßRç(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÝ­s	t	PGDialectcBsÙeZdZeZdZeZeZeZeZ	eZ
eZeZe
ZeZe
ZeZdZeZeZeZeZeZeZeZeZ d1Z"e#j$ie
d6d1d6id6e
d6id6fe#j%ie
d6d1d	6d1d
6d1d6d1d6fgZ&d2Z'eZ(d1d1d1d„Z)d„Z*d„Z+e,ddddgƒZ-d„Z.d„Z/d„Z0d„Z1ee
d„Z2ee
d„Z3d„Z4d„Z5d„Z6d1d„Z7d1d„Z8d1d „Z9d!„Z:e;j<d1d"„ƒZ=e;j<d#„ƒZ>e;j<d1d$„ƒZ?e;j<d1d%„ƒZ@e;j<d1d&„ƒZAe;j<d1d'„ƒZBe;j<d1d(„ƒZCd)„ZDe;j<d1d*„ƒZEe;j<d1e
d+„ƒZFd,„ZGe;j<d-„ƒZHe;j<d1d.„ƒZId1d/„ZJd0„ZKRS(3Rwi?tpyformatRaRdRzRxRftignore_search_pathR”R‘R’Rtpostgresql_ignore_search_pathcKs2tjj||||_||_||_dS(N(RtDefaultDialectRŠtisolation_levelt_json_deserializert_json_serializer(RŒRðtjson_serializertjson_deserializerRÕ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRŠs		cCsÓtt|ƒj|ƒ|jdko7|jjdtƒ|_|jd	k|_|js–|j	j
ƒ|_	|j	jtj
dƒ|j	jtdƒn|jd
k|_|jdkpÉ|jdƒdk|_dS(Niitimplicit_returningii	s show standard_conforming_stringsRJ(ii(ii(i	i(ii(R‰Rët
initializetserver_version_infot__dict__RRÂRõRótcolspecstcopyRñR•tEnumRŽRïRetscalarR4(RŒt
connection((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRös	cs*ˆjdk	r"‡fd†}|SdSdS(Ncsˆj|ˆjƒdS(N(tset_isolation_levelRð(RÒ(RŒ(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytconnect-s(RðRŽ(RŒRÿ((RŒsX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
on_connect+stSERIALIZABLEsREAD UNCOMMITTEDsREAD COMMITTEDsREPEATABLE READcCs‡|jddƒ}||jkrOtjd||jdj|jƒfƒ‚n|jƒ}|jd|ƒ|jdƒ|jƒdS(NR“R^sLInvalid value '%s' for isolation_level. Valid isolation levels for %s are %ss, s=SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL %stCOMMIT(	R5t_isolation_lookupRt
ArgumentErrorRõRrtcursorRötclose(RŒRýtlevelR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRþ6s%
cCs=|jƒ}|jdƒ|jƒd}|jƒ|jƒS(Ns show transaction isolation leveli(RRötfetchoneRR?(RŒRýRtval((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_isolation_levelEs


cCs|j|jƒdS(N(tdo_beginRý(RŒRýtxid((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytdo_begin_twophaseLscCs|jd|ƒdS(NsPREPARE TRANSACTION '%s'(Rö(RŒRýR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytdo_prepare_twophaseOscCsa|rM|r|jdƒn|jd|ƒ|jdƒ|j|jƒn|j|jƒdS(NtROLLBACKsROLLBACK PREPARED '%s'tBEGIN(Rötdo_rollbackRý(RŒRýRtis_preparedtrecover((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytdo_rollback_twophaseRs
cCsa|rM|r|jdƒn|jd|ƒ|jdƒ|j|jƒn|j|jƒdS(NRsCOMMIT PREPARED '%s'R(RöRRýt	do_commit(RŒRýRRR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytdo_commit_twophaseas
cCs3|jtjdƒƒ}g|D]}|d^qS(Ns!SELECT gid FROM pg_prepared_xactsi(RöRR(RŒRýt	resultsettrow((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytdo_recover_twophaselscCs
|jdƒS(Nsselect current_schema()(Rü(RŒRý((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_get_default_schema_nameqsc	Cs[d}|jtj|dtjdtj|jƒƒdtjƒgƒƒ}t	|j
ƒƒS(Ns=select nspname from pg_namespace where lower(nspname)=:schemat
bindparamsRR6(RöRRt	bindparamRR£tlowerR•tUnicodetbooltfirst(RŒRýRtqueryR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt
has_schematsc
Cs¾|dkrN|jtjddtjdtj|ƒdtjƒgƒƒ}n`|jtjddtjdtj|ƒdtjƒtjdtj|ƒdtjƒgƒƒ}t	|j
ƒƒS(Nsˆselect relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where pg_catalog.pg_table_is_visible(c.oid) and relname=:nameRRõR6stselect relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where n.nspname=:schema and relname=:nameR(RŽRöRRRRR£R•RRR (RŒRýRÕRR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt	has_tableƒs 			c
Cs¾|dkrN|jtjddtjdtj|ƒdtjƒgƒƒ}n`|jtjddtjdtj|ƒdtjƒtjdtj|ƒdtjƒgƒƒ}t	|j
ƒƒS(NsSELECT relname FROM pg_class c join pg_namespace n on n.oid=c.relnamespace where relkind='S' and n.nspname=current_schema() and relname=:nameRRõR6s„SELECT relname FROM pg_class c join pg_namespace n on n.oid=c.relnamespace where relkind='S' and n.nspname=:schema and relname=:nameR(RŽRöRRRRR£R•RRR (RŒRýt
sequence_nameRR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pythas_sequence¢s		cCsÁ|dk	r$d}tj|ƒ}nd}tj|ƒ}|jtjdtj|ƒdtjƒƒ}|dk	r¢|jtjdtj|ƒdtjƒƒ}n|j	|ƒ}t
|jƒƒS(Ns
            SELECT EXISTS (
                SELECT * FROM pg_catalog.pg_type t, pg_catalog.pg_namespace n
                WHERE t.typnamespace = n.oid
                AND t.typname = :typname
                AND n.nspname = :nspname
                )
                sË
            SELECT EXISTS (
                SELECT * FROM pg_catalog.pg_type t
                WHERE t.typname = :typname
                AND pg_type_is_visible(t.oid)
                )
                ttypnameR6tnspname(RŽRRRRRR£R•RRöRRü(RŒRýt	type_nameRR!R((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRôÂs		!cCs~|jdƒjƒ}tjd|ƒ}|s@td|ƒ‚ntg|jdddƒD]}|dk	rYt|ƒ^qYƒS(Nsselect version()sJ.*(?:PostgreSQL|EnterpriseDB) (\d+)\.(\d+)(?:\.(\d+))?(?:\.\d+)?(?:devel)?s,Could not determine version from string '%s'iii(	RöRütretmatchtAssertionErrorRêR<RŽtint(RŒRýtvtmRâ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt_get_server_version_infoâs	c
Ksþd}|dk	rd}nd}d|}tj|ƒ}|dk	rXtj|ƒ}ntj|ƒjdtjƒ}|jdtj	ƒ}|rµ|jtj
ddtjƒƒ}n|j|d|d|ƒ}	|	jƒ}|dkrút
j|ƒ‚n|S(	sÝFetch the oid for schema.table_name.

        Several reflection methods require the table oid.  The idea for using
        this method is that it can be fetched one time and cached for
        subsequent calls.

        sn.nspname = :schemas%pg_catalog.pg_table_is_visible(c.oid)sø
            SELECT c.oid
            FROM pg_catalog.pg_class c
            LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE (%s)
            AND c.relname = :table_name AND c.relkind in ('r', 'v', 'm', 'f')
        RÕRRR6N(RŽRR£RRRR•RRWtIntegerRRöRüRtNoSuchTableError(
RŒRýRÕRR¾t	table_oidtschema_where_clauseR!R[RI((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÔís"		
$cKs‘d}|j|ƒ}tjr]g|D]/}|djdƒs%|dj|jƒ^q%}n0g|D]#}|djdƒsd|d^qd}|S(NsS
        SELECT nspname
        FROM pg_namespace
        ORDER BY nspname
        itpg_(RöRtpy2kt
startswithtdecodetencoding(RŒRýR¾R[trpRtschema_names((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_schema_names	s	
2
#cKse|dk	r|}n	|j}|jtjd|ditjd6ƒƒ}g|D]}|d^qQS(Ns€SELECT relname FROM pg_class c WHERE relkind = 'r' AND '%s' = (select nspname from pg_namespace n where n.oid = c.relnamespace) ttypemaptrelnamei(RŽRÖRöRRR•R(RŒRýRR¾RktresultR((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_table_names#	s			cKse|dk	r|}n	|j}|jtjd|ditjd6ƒƒ}g|D]}|d^qQS(Ns€SELECT relname FROM pg_class c WHERE relkind = 'f' AND '%s' = (select nspname from pg_namespace n where n.oid = c.relnamespace) R<R=i(RŽRÖRöRRR•R(RŒRýRR¾RkR>R((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRÙ5	s			cKs™|dk	r|}n	|j}dtd|ƒ}tjrog|j|ƒD]}|dj|jƒ^qJ}n&g|j|ƒD]}|d^q}|S(NsÅ
        SELECT relname
        FROM pg_class c
        WHERE relkind IN ('m', 'v')
          AND '%(schema)s' = (select nspname from pg_namespace n
          where n.oid = c.relnamespace)
        Ri(RŽRÖtdictRR5RöR7R8(RŒRýRR¾RkR[Rt
view_names((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_view_namesG	s			2&c	Ks†|dk	r|}n	|j}d}|jtj|ƒd|d|ƒ}|r‚tjrr|jƒj|j	ƒ}n|jƒ}|SdS(Nsv
        SELECT definition FROM pg_views
        WHERE schemaname = :schema
        AND viewname = :view_name
        t	view_nameR(
RŽRÖRöRRRR5RüR7R8(	RŒRýRCRR¾RkR[R9tview_def((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_view_definition\	s			c	Ks|j|||d|jdƒƒ}d}tj|dtjddtjƒgditjd6tjd6ƒ}|j|d|ƒ}|j	ƒ}	|j
|ƒ}
td	„|j|d
dƒDƒƒ}g}xN|	D]F\}
}}}}}|j
|
||||
||ƒ}|j|ƒqÐW|S(NRÓs6
            SELECT a.attname,
              pg_catalog.format_type(a.atttypid, a.atttypmod),
              (SELECT pg_catalog.pg_get_expr(d.adbin, d.adrelid)
                FROM pg_catalog.pg_attrdef d
               WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum
               AND a.atthasdef)
              AS DEFAULT,
              a.attnotnull, a.attnum, a.attrelid as table_oid
            FROM pg_catalog.pg_attribute a
            WHERE a.attrelid = :table_oid
            AND a.attnum > 0 AND NOT a.attisdropped
            ORDER BY a.attnum
        RR2R6R<tattnameRcssA|]7}|ds+d|d|dfn|d|fVqdS(tvisibles%s.%sRRõN((Råtrec((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>Ž	sRt*(RÔRRRRR•R0RRötfetchallt
_load_domainsR@R×t_get_column_infoRŒ(RŒRýRÕRR¾R2tSQL_COLSR[RItrowstdomainsRòRWRõRtRRvtattnumtcolumn_info((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_columnsp	s(
cCstjdd|ƒ}tjdd|ƒ}|}	|jdƒ}
tjd|ƒ}|rj|jdƒ}ntjd|ƒ}|rµ|jdƒrµttjd|jdƒƒƒ}nd)}i}
|d	kr|r|jd
ƒ\}}t|ƒt|ƒf}q#d*}n|dkr!d+}n|d
kr6d,}ní|d-krnt|
d<|ret|ƒ|
d<nd.}nµ|d/kr¦t	|
d<|rt|ƒ|
d<nd0}n}|dkrÝt|
d<|rÔt|ƒf}q#d1}nF|d2kr|rt|ƒ|
d<nd3}n|r#t|ƒf}nxØtrý||j
krL|j
|}Pq&||kr¥||}t}|d|
d<|ds‘|d|
d<nt|dƒ}Pq&||kró||}|d}|d}	|d r&|r&|d }q&q&q&d}Pq&W|r+|||
Ž}|
rKt
|ƒ}qKn tjd!||fƒtj}t	}|dk	rætjd"|ƒ}|dk	ræt}|}d#|jd$ƒkrã|dk	rã|jdƒd%|d#|jd$ƒ|jd&ƒ}qãqæntd|d'|d|	d |d(|ƒ}|S(4Ns\(.*\)R1s\[\]s[]s\(([\d,]+)\)is\((.*)\)s\s*,\s*Rt,sdouble precisioni5R
stimestamp with time zonestime with time zoneRˆR‹stimestamp without time zonestime without time zoneRsbit varyingRŸR“sinterval year to monthsinterval day to secondRõRGRtlabelstattypeRlRs*Did not recognize type '%s' of column '%s's(nextval\(')([^']+)('.*$)RËis"%s"iRµt
autoincrement(((i5((stimestamp with time zonestime with time zone((stimestamp without time zonestime without time zonestime(((sintervalsinterval year to monthsinterval day to second((R)tsubtendswithtsearchR<RêtsplitR,RÂRt
ischema_namesRïRŽR¼RtwarnR•R´R@(RŒRõRtRRvRORòRRURltis_arraytcharlentargsRÕtprectscaleR¨tenumtdomainRVR*RêRQ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRLœ	s¨$				
		
	
				






		!>c
Ks|j|||d|jdƒƒ}|jdkrLd|jddƒ}nd}tj|ditjd	6ƒ}|j|d
|ƒ}g|j	ƒD]}	|	d^q“}
d}tj|ditjd
6ƒ}|j|d
|ƒ}|j
ƒ}i|
d6|d6S(NRÓiisq
                SELECT a.attname
                FROM
                    pg_class t
                    join pg_index ix on t.oid = ix.indrelid
                    join pg_attribute a
                        on t.oid=a.attrelid AND %s
                 WHERE
                  t.oid = :table_oid and ix.indisprimary = 't'
                ORDER BY a.attnum
            sa.attnums	ix.indkeysµ
                SELECT a.attname
                FROM pg_attribute a JOIN (
                    SELECT unnest(ix.indkey) attnum,
                           generate_subscripts(ix.indkey, 1) ord
                    FROM pg_index ix
                    WHERE ix.indrelid = :table_oid AND ix.indisprimary
                    ) k ON a.attnum=k.attnum
                WHERE a.attrelid = :table_oid
                ORDER BY k.ord
            R<RFR2isŸ
        SELECT conname
           FROM  pg_catalog.pg_constraint r
           WHERE r.conrelid = :table_oid AND r.contype = 'p'
           ORDER BY 1
        tconnametconstrained_columnsRõ(ii(RÔRR÷t
_pg_index_anyRRR•RRöRJRü(
RŒRýRÕRR¾R2tPK_SQLttRItrtcolstPK_CONS_SQLRõ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_pk_constraint
s#cKsA|j}|j|||d|jdƒƒ}d}tjdƒ}	tj|ditjd6tjd6ƒ}
|j	|
d|ƒ}g}x´|j
ƒD]¦\}
}}tj|	|ƒjƒ}|\
}}}}}}}}}}}}}|dk	r|dkrtnt}ngtjd	|ƒD]}|j|ƒ^q!}|rc||jkrZ|}qœ|}n9|r{|j|ƒ}n!|dk	rœ||krœ|}n|j|ƒ}gtjd
|ƒD]}|j|ƒ^q¾}i|
d6|d6|d
6|d6|d6i|d6|d6|d6|d6|d6d6}|j|ƒq“W|S(NRÓsª
          SELECT r.conname,
                pg_catalog.pg_get_constraintdef(r.oid, true) as condef,
                n.nspname as conschema
          FROM  pg_catalog.pg_constraint r,
                pg_namespace n,
                pg_class c

          WHERE r.conrelid = :table AND
                r.contype = 'f' AND
                c.oid = confrelid AND
                n.oid = c.relnamespace
          ORDER BY 1
        s/FOREIGN KEY \((.*?)\) REFERENCES (?:(.*?)\.)?(.*?)\((.*?)\)[\s]?(MATCH (FULL|PARTIAL|SIMPLE)+)?[\s]?(ON UPDATE (CASCADE|RESTRICT|NO ACTION|SET NULL|SET DEFAULT)+)?[\s]?(ON DELETE (CASCADE|RESTRICT|NO ACTION|SET NULL|SET DEFAULT)+)?[\s]?(DEFERRABLE|NOT DEFERRABLE)?[\s]?(INITIALLY (DEFERRED|IMMEDIATE)+)?R<RdtcondefRYt
DEFERRABLEs\s*,\s*s\s*,\sRõRetreferred_schematreferred_tabletreferred_columnstonupdatetondeleteR/R?R*toptions(RºRÔRR)tcompileRRR•RRöRJRYtgroupsRŽRÂRRZRÊRÖRŒ(RŒRýRÕRRîR¾R7R2tFK_SQLtFK_REGEXRhRItfkeysRdRmt	conschemaR.ReRoRpRqR“R*RrRsR/R?Râtfkey_d((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_foreign_keys;
sX		

-%			+csN|jd	kr<ddj‡‡fd†tddƒDƒƒSdˆˆfSdS(
Niis(%s)s OR c3s"|]}dˆ|ˆfVqdS(s%s[%d] = %sN((Råtind(RFt
compare_to(sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pys	<genexpr>Ÿ
sii
s%s = ANY(%s)(ii(R÷Rrtrange(RŒRFR~((RFR~sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRf–
s
	cKs+|j|||d|jdƒƒ}|jd!krd|jd"krKdnd|jd#krcd	nd
|jddƒf}nd
}tj|ditjd6ƒ}|j|d|ƒ}t	d„ƒ}	d}
xy|jƒD]k}|\
}}
}}}}}}}}|r7||
kr+tj
d|ƒn|}
qÛn|rd||
krdtj
d|ƒ|}
n||	k}|	|}|dk	r—||d|<n|sÛg|jƒD]}t|jƒƒ^qª|d<|
|d<|dk	rï||d<n|r$tg|D]}|jdƒ^qÿƒ|d<n|rF|dkrF||d<qFqÛqÛWg}xÔ|	jƒD]Æ\}}i|d6|dd6g|dD]}|d|^q‰d6}d|krÄ|d|d<nd|krí|d|jdiƒd<nd|kr|d|jdiƒd <n|j|ƒq]W|S($NRÓiis†
              SELECT
                  i.relname as relname,
                  ix.indisunique, ix.indexprs, ix.indpred,
                  a.attname, a.attnum, NULL, ix.indkey%s,
                  %s, am.amname
              FROM
                  pg_class t
                        join pg_index ix on t.oid = ix.indrelid
                        join pg_class i on i.oid = ix.indexrelid
                        left outer join
                            pg_attribute a
                            on t.oid = a.attrelid and %s
                        left outer join
                            pg_am am
                            on i.relam = am.oid
              WHERE
                  t.relkind IN ('r', 'v', 'f', 'm')
                  and t.oid = :table_oid
                  and ix.indisprimary = 'f'
              ORDER BY
                  t.relname,
                  i.relname
            is	::varcharR1isi.reloptionstNULLsa.attnums	ix.indkeysÂ
              SELECT
                  i.relname as relname,
                  ix.indisunique, ix.indexprs, ix.indpred,
                  a.attname, a.attnum, c.conrelid, ix.indkey::varchar,
                  i.reloptions, am.amname
              FROM
                  pg_class t
                        join pg_index ix on t.oid = ix.indrelid
                        join pg_class i on i.oid = ix.indexrelid
                        left outer join
                            pg_attribute a
                            on t.oid = a.attrelid and a.attnum = ANY(ix.indkey)
                        left outer join
                            pg_constraint c
                            on (ix.indrelid = c.conrelid and
                                ix.indexrelid = c.conindid and
                                c.contype in ('p', 'u', 'x'))
                        left outer join
                            pg_am am
                            on i.relam = am.oid
              WHERE
                  t.relkind IN ('r', 'v', 'f', 'm')
                  and t.oid = :table_oid
                  and ix.indisprimary = 'f'
              ORDER BY
                  t.relname,
                  i.relname
            R<RFR2cSs
ttƒS(N(RR@(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt<lambda>ð
ss;Skipped unsupported reflection of expression-based index %ss7Predicate of partial index %s ignored during reflectionRjR|R_tduplicates_constraintt=RttbtreetamnameRõtcolumn_namesR~tpostgresql_withtpostgresql_using(ii(ii(ii(RÔRR÷RfRRR•RRöRRŽRJRR\RZR,tstripR@R„t
setdefaultRŒ(RŒRýRÕRR¾R2tIDX_SQLRhRItindexestsv_idx_nameRtidx_nameR_R®tprdRFtcol_numtconrelidtidx_keyRtR…thas_idxRÏtktoptionR>Rõtidxtitentry((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_indexes¥
sn$	
/

,)cKs|j|||d|jdƒƒ}d}tj|ditjd6ƒ}|j|d|ƒ}td„ƒ}	xB|jƒD]4}
|	|
j	}|
j
|d<|
j|d|
j<qzWg|	j
ƒD]?\}}i|d	6g|dD]}
|d|
^qàd
6^q¿S(NRÓsÜ
            SELECT
                cons.conname as name,
                cons.conkey as key,
                a.attnum as col_num,
                a.attname as col_name
            FROM
                pg_catalog.pg_constraint cons
                join pg_attribute a
                  on cons.conrelid = a.attrelid AND
                    a.attnum = ANY(cons.conkey)
            WHERE
                cons.conrelid = :table_oid AND
                cons.contype = 'u'
        R<tcol_nameR2cSs
ttƒS(N(RR@(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyREsR|RjRõR†(RÔRRRR•RRöRRJRõR|RšRR„(RŒRýRÕRR¾R2t
UNIQUE_SQLRhRItuniquesRtucRõR—((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pytget_unique_constraints,s

cCsK|p|j}|jsiSd}|dkr;|d7}n|d7}tj|ditjd6tjd6ƒ}|dkr|jd|ƒ}n|j|ƒ}g}i}xš|jƒD]Œ}|d|d	f}	|	|krù||	d
j	|dƒq·i|d	d	6|dd6|dd6|dgd
6||	<}
|j	|
ƒq·W|S(Nsý
            SELECT t.typname as "name",
               -- no enum defaults in 8.4 at least
               -- t.typdefault as "default",
               pg_catalog.pg_type_is_visible(t.oid) as "visible",
               n.nspname as "schema",
               e.enumlabel as "label"
            FROM pg_catalog.pg_type t
                 LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
                 LEFT JOIN pg_catalog.pg_enum e ON t.oid = e.enumtypid
            WHERE t.typtype = 'e'
        RIsAND n.nspname = :schema s ORDER BY "schema", "name", e.oidR<RFtlabelRRõRTRG(
RÖRóRRR•RRRöRJRŒ(RŒRýRt	SQL_ENUMSR[RIRòtenum_by_nameRbR|tenum_rec((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyR×Qs4	


c	CsÊd}tj|ditjd6ƒ}|j|ƒ}i}x‰|jƒD]{}tjd|dƒjdƒ}|drƒ|d}nd	|d
|df}i|d6|dd6|dd6||<qGW|S(
NsÕ
            SELECT t.typname as "name",
               pg_catalog.format_type(t.typbasetype, t.typtypmod) as "attype",
               not t.typnotnull as "nullable",
               t.typdefault as "default",
               pg_catalog.pg_type_is_visible(t.oid) as "visible",
               n.nspname as "schema"
            FROM pg_catalog.pg_type t
               LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
            WHERE t.typtype = 'd'
        R<RFs([^\(]+)RUiRGRõs%s.%sRRlR(	RRR•RRöRJR)RYR<(	RŒRýtSQL_DOMAINSR[RIRORcRURõ((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRK„s

N(spostgresql_ignore_search_path(LR~RRõRÂtsupports_altertmax_identifier_lengthtsupports_sane_rowcountRótsupports_native_booleanRetsupports_sequencestsequences_optionalt"preexecute_autoincrement_sequencesRtpostfetch_lastrowidtsupports_default_valuestsupports_empty_inserttsupports_multivalues_inserttdefault_paramstyleR[RùR!tstatement_compilerR]tddl_compilerRšRjRÆR7RÝtexecution_ctx_clsRÐt	inspectorRŽRðRtIndextTabletconstruct_argumentstreflection_optionsR4RŠRöRRÿRRþR
R
RRRRRR"R#R%RôR/RtcacheRÔR;R?RÙRBRERRRLRlR|RfR™RžR×RK(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyRëÝs¤	
								
			  	#+	o/Y	‡#3(^R†tcollectionsRR)tdatetimeR˜R1RRRRtengineRRRRR	R
RR•RRR tImportErrorRŽtsqlalchemy.typesR
RRRRRRRRRRRÿRÎt_DECIMAL_TYPESt_FLOAT_TYPESt
_INT_TYPEStLargeBinaryR}tFloatRt
TypeEngineR‚tPGInetRƒtPGCidrR„t	PGMacAddrR…R‡RRt
PGIntervalRtPGBittPGUuidRªt
ColumnElementR«R¶R»tTupleRRÛR¼tPGArrayRûRïR–RùtStringR[tSQLCompilerR!tDDLCompilerR]tGenericTypeCompilerRštIdentifierPreparerRÆRÑRÐt_CreateDropBaseR÷RútDefaultExecutionContextRÝRïRë(((sX/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.pyt<module>asÌ""

L
2
3ÿ3È




•¢o.0