Files
Home-AssistantConfig/deps/sqlalchemy/dialects/postgresql/__pycache__/base.cpython-34.pyc

1387 lines
97 KiB
Plaintext
Raw Normal View History

2016-10-11 16:42:06 +00:00
<EFBFBD>
}<7D><>W<EFBFBD><57><00>o@sgdZddlmZddlZddlZddlmZmZm Z m
Z
ddl m Z m Z ddlmZmZmZmZddlmZydd lmZWnek
r<>dZYnXdd
lmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#e$d d 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<00>Z%dqdrfZ&dsdtdudvfZ'dwdxdydzd{d|d}fZ(Gd~d<00>dej)<00>Z*Gd<47>d<><00>d<>ej+<00>Z,Gd<47>d<><00>d<>ej-<00>Z.e.Z/Gd<47>d<><00>d<>ej-<00>Z0e0Z1Gd<47>d<><00>d<>ej-<00>Z2e2Z3Gd<47>d<><00>d<>ej-<00>Z4Gd<47>d<><00>d<>ej5<00>Z5Gd<47>d<><00>d<>ej6<00>Z6Gd<47>d<><00>d<>ej-<00>Z7e7Z8Gd<47>d<><00>d<>ej-<00>Z9e9Z:Gd<47>d<><00>d<>ej-<00>ZeZ;Gd<47>d<><00>d<>ej-<00>Z<Gd<47>d<><00>d<>ej=<00>Z>Gd<47>d<><00>d<>ej=<00>Z?Gd<47>d<><00>d<>ej=<00>Z@Gd<47>d<00>dejA<00>ZBGd<47>d<><00>d<>ejCej-<00>ZDeDZEGd<47>d<><00>d<>ejF<00>ZGie7ejH6eGejF6ZIi ed<>6ed<>6ed<>6ed<>6ed<>6ejJd<>6ejJd<>6ed<>6e d<>6ed<>6e#d<>6e.d<>6e0d<>6ed<>6e9d<>6e9d<>6e2d<>6e4d<>6e,d<>6e5d<>6e5d<>6e5d<>6e6d<>6e6d<>6e!d<>6e6d<>6e*d<>6e"d<>6e7d<>6e7d<>6e7d<>6e<d<>6ZKGd<47>d<><00>d<>ejL<00>ZMGd<47>d<><00>d<>ejN<00>ZOGd<47>d<><00>d<>ejP<00>ZQGd<47>d<><00>d<>ejR<00>ZSGd<47>d<><00>d<>e jT<00>ZUGd<47>d<><00>d<>ejV<00>ZWGd<47>d<><00>d<>ejV<00>ZXGd<47>d<><00>d<>e jY<00>ZZGd<47>d<><00>d<>e j[<00>Z\dS)<29>avP
.. 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
.. _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.
<EFBFBD>)<01> defaultdictN<74>)<04>sql<71>schema<6D>exc<78>util)<02>default<6C>
reflection)<04>compiler<65>
expression<EFBFBD> operators<72>default_comparator)<01>types)<01>UUID) <0B>INTEGER<45>BIGINT<4E>SMALLINT<4E>VARCHAR<41>CHAR<41>TEXT<58>FLOAT<41>NUMERIC<49>DATE<54>BOOLEAN<41>REAL<41>allZanalyseZanalyze<7A>and<6E>any<6E>array<61>asZascZ
asymmetricZbothZcase<73>cast<73>checkZcollate<74>column<6D>
constraint<EFBFBD>createZcurrent_catalogZ current_dateZ current_role<6C> current_timeZcurrent_timestampZ current_userr<00>
deferrable<EFBFBD>descZdistinctZdo<64>else<73>end<6E>except<70>false<73>fetch<63>forZforeign<67>fromZgrant<6E>groupZhaving<6E>in<69> initiallyZ intersectZinto<74>leading<6E>limit<69> localtimeZlocaltimestamp<6D>new<65>not<6F>null<6C>of<6F>off<66>offset<65>old<6C>on<6F>only<6C>or<6F>orderZplacingZprimaryZ
referencesZ returning<6E>selectZ session_userZsomeZ symmetric<69>tableZthen<65>toZtrailing<6E>true<75>union<6F>unique<75>user<65>usingZvariadic<69>when<65>whereZwindow<6F>with<74> authorizationZbetween<65>binaryZcross<73>current_schema<6D>freeze<7A>fullZilike<6B>inner<65>isZisnull<6C>join<69>leftZlikeZnatural<61>notnull<6C>outerZover<65>overlaps<70>rightZsimilar<61>verbosei<65>i<>i<>i<>i<>i<><00><00><00><00>i<>i<>i<>c@seZdZdZdS)<02>BYTEAN)<04>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__visit_name__<5F>rbrb<00>I/tmp/pip-build-zkr322cu/sqlalchemy/sqlalchemy/dialects/postgresql/base.pyr]as r]c@seZdZdZdS)<02>DOUBLE_PRECISIONN)r^r_r`rarbrbrbrcrdes rdc@seZdZdZdS)<02>INETN)r^r_r`rarbrbrbrcreis rec@seZdZdZdS)<02>CIDRN)r^r_r`rarbrbrbrcrfns rfc@seZdZdZdS)<02>MACADDRN)r^r_r`rarbrbrbrcrgss rgc@seZdZdZdZdS)<03>OIDzCProvide the Postgresql OID type.
.. versionadded:: 0.9.5
N)r^r_r`<00>__doc__rarbrbrbrcrhxs rhcs(eZdZdd<00>fdd<00>Z<00>S)<05> TIMESTAMPFNcs&tt|<00>jd|<00>||_dS)N<>timezone)<04>superrj<00>__init__<5F> precision)<03>selfrkrn)<01> __class__rbrcrm<00>szTIMESTAMP.__init__)r^r_r`rmrbrb)rprcrj<00>s rjcs(eZdZdd<00>fdd<00>Z<00>S)<05>TIMEFNcs&tt|<00>jd|<00>||_dS)Nrk)rlrqrmrn)rorkrn)rprbrcrm<00>sz TIME.__init__)r^r_r`rmrbrb)rprcrq<00>s rqc@saeZdZdZdZddd<00>Zedd<00><00>Zedd<00><00>Z ed d
<00><00>Z
dS) <0B>INTERVALz<4C>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.
NcCs ||_dS)N)rn)rornrbrbrcrm<00>szINTERVAL.__init__cCstd|j<00>S)Nrn)rrZsecond_precision)<02>cls<6C>intervalrbrbrc<00>_adapt_from_generic_interval<61>sz%INTERVAL._adapt_from_generic_intervalcCstjS)N)<02>sqltypes<65>Interval)rorbrbrc<00>_type_affinity<74>szINTERVAL._type_affinitycCstjS)N)<02>dt<64> timedelta)rorbrbrc<00> python_type<70>szINTERVAL.python_type) r^r_r`rirarm<00> classmethodru<00>propertyrxr{rbrbrbrcrr<00>s rrc@s(eZdZdZdddd<00>ZdS)<05>BITNFcCs.|s|pd|_n ||_||_dS)N<>)<02>length<74>varying)ror<>r<>rbrbrcrm<00>s z BIT.__init__)r^r_r`rarmrbrbrbrcr~<00>s r~c@sCeZdZdZdZddd<00>Zdd<00>Zdd<00>Zd S)
ra
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.
FcCs.|r!tdkr!td<00><00>n||_dS)z<>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.
Nz=This version of Python does not support the native UUID type.)<03> _python_UUID<49>NotImplementedError<6F>as_uuid)ror<>rbrbrcrm<00>s  z UUID.__init__cCs!|jrdd<00>}|SdSdS)NcSs"|dk rtj|<00>}n|S)N)r<00> text_type)<01>valuerbrbrc<00>process<73>s z$UUID.bind_processor.<locals>.process)r<>)ro<00>dialectr<74>rbrbrc<00>bind_processor<6F>s  zUUID.bind_processorcCs!|jrdd<00>}|SdSdS)NcSs|dk rt|<00>}n|S)N)r<>)r<>rbrbrcr<><00>s z&UUID.result_processor.<locals>.process)r<>)ror<><00>coltyper<65>rbrbrc<00>result_processor<6F>s  zUUID.result_processorN)r^r_r`rirarmr<>r<>rbrbrbrcr<00>s

rc@seZdZdZdZdS)<03>TSVECTORaThe :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`
N)r^r_r`rirarbrbrbrcr<><00>s r<>c@s+eZdZdZejZdd<00>ZdS)<05>_Slice<63>slicecCsFtj|jtj|j<00>|_tj|jtj|j<00>|_dS)N)r Z_check_literal<61>exprr <00>getitem<65>start<72>stop)roZslice_Zsource_comparatorrbrbrcrms z_Slice.__init__N)r^r_r`rarv<00>NULLTYPE<50>typermrbrbrbrcr<>s  r<>c@s.eZdZdZdZejdd<00>ZdS)<06>Anyz<79>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<00>|_tj|<00>|_||_||_dS)N)rv<00>Booleanr<6E>r <00>_literal_as_bindsrSrW<00>operator)rorSrWr<>rbrbrcrms z Any.__init__N)r^r_r`rirar <00>eqrmrbrbrbrcr<>s r<>c@s.eZdZdZdZejdd<00>ZdS)<06>Allz<6C>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<00>|_tj|<00>|_||_||_dS)N)rvr<>r<>r r<>rSrWr<>)rorSrWr<>rbrbrcrm2s z All.__init__N)r^r_r`rirar r<>rmrbrbrbrcr<>$s r<>csIeZdZdZdZ<00>fdd<00>Zdd<00>Zddd<00>Z<00>S) ra<>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`
c s/tt|<00>j||<00>t|j<00>|_dS)N)rlrrm<00>ARRAYr<59>)ro<00>clauses<65>kw)rprbrcrm]szarray.__init__cs t<00><00>fdd<00>|D<><00>S)Nc s7g|]-}tjd|d<00>d<00>jdd<00><03>qS)NZ_compared_to_operatorZ_compared_to_typerET)r Z BindParameterr<72>)<02>.0<EFBFBD>o)r<>rorbrc<00>
<listcomp>cs z%array._bind_param.<locals>.<listcomp>)r)ror<><00>objrb)r<>rorc<00> _bind_paramaszarray._bind_paramNcCs|S)Nrb)roZagainstrbrbrc<00>
self_grouphszarray.self_group)r^r_r`rirarmr<>r<>rbrb)rprcr9s
! c@s<>eZdZdZdZGdd<00>dejj<00>ZeZddddd<00>Z e
dd <00><00>Z d
d <00>Z d d <00>Z dd<00>Zdd<00>ZdS)r<>a 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.
c@sveZdZdZdd<00>Zejdd<00>Zejdd<00>Zdd <00>Z d
d <00>Z
d d <00>Z dd<00>Z dS)zARRAY.Comparatorz1Define comparison operations for :class:`.ARRAY`.cCs<>|jjjrdnd}t|t<00>rq|rVt|j||j||j<00>}nt||<00>}|j}n||7}|jj }t
j |jt j |d|<00>S)NrrZ result_type)r<>r<><00> zero_indexes<65>
isinstancer<EFBFBD>r<>r<><00>stepr<70><00> item_typer Z_binary_operater r<>)ro<00>indexZ shift_indexesZ return_typerbrbrc<00> __getitem__<5F>s

 
 zARRAY.Comparator.__getitem__cCst||jd|<00>S)aReturn ``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<>)ro<00>otherr<72>rbrbrcr<00>szARRAY.Comparator.anycCst||jd|<00>S)aReturn ``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<>)ror<>r<>rbrbrcr<00>szARRAY.Comparator.allcKs|jjd<00>|<00>S)zBoolean expression. Test if elements are a superset of the
elements of the argument array expression.
z@>)r<><00>op)ror<><00>kwargsrbrbrc<00>containsszARRAY.Comparator.containscCs|jjd<00>|<00>S)z<>Boolean expression. Test if elements are a proper subset of the
elements of the argument array expression.
z<@)r<>r<>)ror<>rbrbrc<00> contained_byszARRAY.Comparator.contained_bycCs|jjd<00>|<00>S)zuBoolean expression. Test if array has elements in common with
an argument array expression.
z&&)r<>r<>)ror<>rbrbrc<00>overlap%szARRAY.Comparator.overlapcCsJt|tj<00>r1|jdkr1|tjfSntjjj|||<00>S)N<>@><3E><@<40>&&)r<>r<>r<>) r<>r Z custom_opZopstringrvr<><00> Concatenable<6C>
Comparator<EFBFBD>_adapt_expression)ror<>Zother_comparatorrbrbrcr<>+sz"ARRAY.Comparator._adapt_expressionN) r^r_r`rir<>r r<>rrr<>r<>r<>r<>rbrbrbrcr<><00>s     r<>FNcCsat|t<00>rtd<00><00>nt|t<00>r9|<00>}n||_||_||_||_dS)aOConstruct 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
zUDo not nest ARRAY types; ARRAY(basetype) handles multi-dimensional arrays of basetypeN)r<>r<><00>
ValueErrorr<EFBFBD>r<><00>as_tuple<6C>
dimensionsr<EFBFBD>)ror<>r<>r<>r<>rbrbrcrm4s$    zARRAY.__init__cCstS)N)<01>list)rorbrbrcr{bszARRAY.python_typecCs
||kS)Nrb)ro<00>x<>yrbrbrc<00>compare_valuesfszARRAY.compare_valuescs<><00>dkrt|<00>}n<00>dksT<00>dkr<>| sTt|dttf<00> r<><00>rw<00><00>fdd<00>|D<><00>S<>|<00>Sn&<00><00><00><00><00>fdd<00>|D<><00>SdS)Nrrc3s|]}<00>|<00>VqdS)Nrb)r<>r<>)<01>itemprocrbrc<00> <genexpr>rsz$ARRAY._proc_array.<locals>.<genexpr>c3s=|]3}<00>j|<00><00>dk r+<00>dnd<00><00>VqdS)Nr)<01> _proc_array)r<>r<>)<04>
collection<EFBFBD>dimr<6D>rorbrcr<>ws)r<>r<><00>tuple)roZarrr<72>r<>r<>rb)r<>r<>r<>rorcr<>is ! zARRAY._proc_arraycs4<00>jj|<00>j|<00><00><00><00>fdd<00>}|S)Ncs-|dkr|S<>j|<00><00>jt<00>SdS)N)r<>r<>r<>)r<>)<02> item_procrorbrcr<><00>s z%ARRAY.bind_processor.<locals>.process)r<><00> dialect_implr<6C>)ror<>r<>rb)r<>rorcr<>~s zARRAY.bind_processorcs7<00>jj|<00>j||<00><00><00><00>fdd<00>}|S)Ncs<|dkr|S<>j|<00><00>j<00>jr1tnt<00>SdS)N)r<>r<>r<>r<>r<>)r<>)r<>rorbrcr<><00>s z'ARRAY.result_processor.<locals>.process)r<>r<>r<>)ror<>r<>r<>rb)r<>rorcr<><00>s zARRAY.result_processor)r^r_r`rirarvr<>r<>Zcomparator_factoryrmr}r{r<>r<>r<>r<>rbrbrbrcr<>ls Wl-   r<>cs<>eZdZdZ<00>fdd<00>Zdddd<00>Zdddd <00>Zd
d <00>Zd d <00>Zdd<00>Z dd<00>Z
dd<00>Z <00>S)<14>ENUMa<4D> 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.
cs2|jdd<00>|_tt|<00>j||<00>dS)a&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
<20> create_typeTN)<05>popr<70>rlr<>rm)ro<00>enumsr<73>)rprbrcrm<00>sz ENUM.__init__NTcCsS|jjsdS| s9|jj||jd|j<00> rO|jt|<00><00>ndS)a<>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<><00>supports_native_enum<75>has_type<70>namer<00>execute<74>CreateEnumType)ro<00>bind<6E>
checkfirstrbrbrcr$s   z ENUM.createcCsR|jjsdS| s8|jj||jd|j<00>rN|jt|<00><00>ndS)a<>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<><00> DropEnumType)ror<>r<>rbrbrc<00>drop's
 !z ENUM.dropcCs<>|js dSd|kry|d}d|jkrB|jd}nt<00>}|jd<|j|k}|j|j<00>|SdSdS)aLook 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".
TZ _ddl_runnerZ _pg_enumsFN)r<><00>memo<6D>setr<74><00>add)ror<>r<>Z
ddl_runnerZpg_enumsZpresentrbrbrc<00>_check_for_name_in_memos=s  
zENUM._check_for_name_in_memoscKsS|s6|j rO|jdd<00> rO|j||<00> rO|jd|d|<00>ndS)N<>_is_metadata_operationFr<46>r<>)<04>metadata<74>getr<74>r$)ro<00>targetr<74>r<>r<>rbrbrc<00>_on_table_createTs

zENUM._on_table_createcKsM|j rI|jdd<00> rI|j||<00> rI|jd|d|<00>ndS)Nr<4E>Fr<46>r<>)r<>r<>r<>r<>)ror<>r<>r<>r<>rbrbrc<00>_on_table_drop[s
zENUM._on_table_dropcKs/|j||<00>s+|jd|d|<00>ndS)Nr<4E>r<>)r<>r$)ror<>r<>r<>r<>rbrbrc<00>_on_metadata_createaszENUM._on_metadata_createcKs/|j||<00>s+|jd|d|<00>ndS)Nr<4E>r<>)r<>r<>)ror<>r<>r<>r<>rbrbrc<00>_on_metadata_dropeszENUM._on_metadata_drop) r^r_r`rirmr$r<>r<>r<>r<>r<>r<>rbrb)rprcr<><00>s L     r<><00>integerZbigintZsmallintzcharacter varying<6E> characterz"char"r<><00>text<78>numeric<69>float<61>realZinetZcidr<64>uuid<69>bitz bit varyingZmacaddr<64>oidzdouble precision<6F> timestampztimestamp with time zoneztimestamp without time zoneztime with time zoneztime without time zone<6E>date<74>timeZbytea<65>booleanrtzinterval year to monthzinterval day to secondZtsvectorcs<>eZdZdd<00>Zdd<00>Zdd<00>Zdd<00>Zd d
<00>Zd d <00>Zd d<00>Z dd<00>Z
<00>fdd<00>Z dd<00>Z dd<00>Z dd<00>Zdd<00>Zdd<00>Zdd<00>Zdd <00>Z<00>S)!<21>
PGCompilercKsd|j||<00>S)Nz ARRAY[%s])Zvisit_clauselist)ro<00>elementr<74>rbrbrc<00> visit_array<61>szPGCompiler.visit_arraycKs,d|j|j|<00>|j|j|<00>fS)Nz%s:%s)r<>r<>r<>)ror<>r<>rbrbrc<00> visit_slice<63>szPGCompiler.visit_slicecKs9d|j|j|<00>tj|j|j|j|<00>fS)Nz %s%sANY (%s))r<>rSr
<00> OPERATORSr<53>rW)ror<>r<>rbrbrc<00> visit_any<6E>s zPGCompiler.visit_anycKs9d|j|j|<00>tj|j|j|j|<00>fS)Nz %s%sALL (%s))r<>rSr
r<>r<>rW)ror<>r<>rbrbrc<00> visit_all<6C>s zPGCompiler.visit_allcKs,d|j|j|<00>|j|j|<00>fS)Nz%s[%s])r<>rSrW)rorLr<>r<>rbrbrc<00>visit_getitem_binary<72>szPGCompiler.visit_getitem_binarycKs<>d|jkrc|j|jdtj<00>}|rcd|j|j|<00>||j|j|<00>fSnd|j|j|<00>|j|j|<00>fS)NZpostgresql_regconfigz%s @@ to_tsquery(%s, %s)z%s @@ to_tsquery(%s))<07> modifiers<72>render_literal_valuerv<00>
STRINGTYPEr<EFBFBD>rSrW)rorLr<>r<>Z regconfigrbrbrc<00>visit_match_op_binary<72>s
 z PGCompiler.visit_match_op_binarycKsd|jjdd<00>}d|j|j|<00>|j|j|<00>f|r_d|j|tj<00>ndS)N<>escapez %s ILIKE %sz ESCAPE <20>)r<>r<>r<>rSrWr<>rvr<>)rorLr<>r<>r<>rbrbrc<00>visit_ilike_op_binary<72>s
z PGCompiler.visit_ilike_op_binarycKsd|jjdd<00>}d|j|j|<00>|j|j|<00>f|r_d|j|tj<00>ndS)Nr<4E>z%s NOT ILIKE %sz ESCAPE r<>)r<>r<>r<>rSrWr<>rvr<>)rorLr<>r<>r<>rbrbrc<00>visit_notilike_op_binary<72>s
z#PGCompiler.visit_notilike_op_binarycs@tt|<00>j||<00>}|jjr<|jdd<00>}n|S)N<>\z\\)rlr<>r<>r<><00>_backslash_escapes<65>replace)ror<><00>type_)rprbrcr<><00>s zPGCompiler.render_literal_valuecCsd|jj|<00>S)Nz nextval('%s'))<02>preparer<65>format_sequence)ro<00>seqrbrbrc<00>visit_sequence<63>szPGCompiler.visit_sequencecKs<>d}|jdk r5|d|j|j|<00>7}n|jdk r<>|jdkr`|d7}n|d|j|j|<00>7}n|S)Nr<4E>z
LIMIT z
LIMIT ALLz OFFSET )Z _limit_clauser<65>Z_offset_clause)ror@r<>r<>rbrbrc<00> limit_clause<73>s   zPGCompiler.limit_clausecCs0|j<00>dkr(tjd|<16><00>nd|S)NZONLYzUnrecognized hint: %rzONLY )<03>upperr<00> CompileError)roZsqltextrAZhintZiscrudrbrbrc<00>format_from_hint_text<78>sz PGCompiler.format_from_hint_textc s<>|jdk r<>|jdkr"dSt|jttf<00>reddj<00>fdd<00>|jD<><00>dSd<00>j|j|<00>dSnd SdS)
NFTz DISTINCT z DISTINCT ON (z, csg|]}<00>j|<00><00>qSrb)r<>)r<><00>col)rorbrcr<><00>s z4PGCompiler.get_select_precolumns.<locals>.<listcomp>z) r<>)Z _distinctr<74>r<>r<>rRr<>)ror@r<>rb)rorc<00>get_select_precolumns<6E>s+z PGCompiler.get_select_precolumnsc s<>|jjrd}nd}|jjrytjdd<00>|jjD<><00>}|ddj<00><00>fdd<00>|D<><00>7}n|jjr<>|d7}n|S) Nz
FOR SHAREz FOR UPDATEcss0|]&}t|tj<00>r$|jn|VqdS)N)r<>r <00> ColumnClauserA)r<><00>crbrbrcr<>sz/PGCompiler.for_update_clause.<locals>.<genexpr>z OF z, c3s-|]#}<00>j|dddd<00><00>VqdS)ZashintT<74>
use_schemaFN)r<>)r<>rA)r<>rorbrcr<> sz NOWAIT)Z_for_update_arg<72>readr8rZ
OrderedSetrRZnowait)ror@r<><00>tmpZtablesrb)r<>rorc<00>for_update_clause<73>s       zPGCompiler.for_update_clausecs3<00>fdd<00>tj|<00>D<>}ddj|<00>S)Ncs+g|]!}<00>jd|ddi<00><00>qS)NTF)Z_label_select_column)r<>r
)rorbrcr<>s z/PGCompiler.returning_clause.<locals>.<listcomp>z
RETURNING z, )r Z_select_iterablesrR)roZstmtZreturning_cols<6C>columnsrb)rorc<00>returning_clauseszPGCompiler.returning_clausecKs<>|j|jjd|<00>}|j|jjd|<00>}t|jj<00>dkr}|j|jjd|<00>}d|||fSd||fSdS)Nrr<00>zSUBSTRING(%s FROM %s FOR %s)zSUBSTRING(%s FROM %s))r<>r<><00>len)ro<00>funcr<63><00>sr<73>r<>rbrbrc<00>visit_substring_funcs zPGCompiler.visit_substring_func)r^r_r`r<>r<>r<>r<>r<>r<>r<>r<>r<>rrrrrrrrbrb)rprcr<><00>s         
   r<>c@sXeZdZdd<00>Zdd<00>Zdd<00>Zdd<00>Zd d
<00>Zd d <00>Zd S)<0E> PGDDLCompilercKsf|jj|<00>}|jj|j<00>}t|tj<00>rE|j}n|j r<>||j
j kr<>|jj st|tj <00> r<>|jdks<>t|jtj<00>r<>|jjr<>t|tj<00>r<>|d7}qLt|tj <00>r<>|d7}qL|d7}nR|d|jjj|jd|<00>7}|j|<00>}|dk rL|d|7}n|jsb|d7}n|S)Nz
BIGSERIALz SMALLSERIALz SERIAL<41> Ztype_expressionz DEFAULT z NOT NULL)r<>Z format_columnr<6E>r<>r<>r<>rvZ TypeDecorator<6F>impl<70> primary_keyrA<00>_autoincrement_column<6D>supports_smallserialZ SmallIntegerrr<00>Sequence<63>optionalZ
BigInteger<EFBFBD> type_compilerr<72>Zget_column_default_string<6E>nullable)ror"r<>ZcolspecZ impl_typerrbrbrc<00>get_column_specification)s0           z&PGDDLCompiler.get_column_specificationcsB|j}d<00>jj|<00>dj<00>fdd<00>|jD<><00>fS)NzCREATE TYPE %s AS ENUM (%s)z, c3s0|]&}<00>jjtj|<00>dd<00>VqdS)<03> literal_bindsTN)<04> sql_compilerr<72>r<00>literal)r<><00>e)rorbrcr<>Rsz7PGDDLCompiler.visit_create_enum_type.<locals>.<genexpr>)r<>r<><00> format_typerRr<>)ror$r<>rb)rorc<00>visit_create_enum_typeLs  z$PGDDLCompiler.visit_create_enum_typecCs|j}d|jj|<00>S)Nz DROP TYPE %s)r<>r<>r%)ror<>r<>rbrbrc<00>visit_drop_enum_typeVs z"PGDDLCompiler.visit_drop_enum_typec
s<><00>j}|j}<00>j|<00>d}|jr;|d7}n|d7}|jdd}|ri|d7}n|d<00>j|dd <00>|j|j<00>f7}|jdd
}|r<>|d |j|<00>7}n|jdd <19>|d dj <00><00>fdd<00>|j
D<><00>7}|jdd}|rN|ddj dd<00>|j <00>D<><00>7}n|jdd}|dk r<><01>j j |dd dd<00>} |d| 7}n|S)NzCREATE zUNIQUE zINDEX <20>
postgresql<EFBFBD> concurrentlyz CONCURRENTLY z %s ON %s Zinclude_schemaFrGz USING %s <20>opsz(%s)z, csg|]u}<00>jjt|tj<00>s3|j<00>n|dddd<00>t|d<00>rt|j<00>krtd<00>|jnd<17>qS)<07> include_tableFr!T<>keyrr<>)r"r<>r<>r r r<><00>hasattrr,)r<>r<>)r*rorbrcr<>xs
z4PGDDLCompiler.visit_create_index.<locals>.<listcomp>rJz
WITH (%s)cSsg|]}d|<16>qS)z%s = %srb)r<>Zstorage_parameterrbrbrcr<><00>s rIr+r!Tz WHERE )r<>r<>Z_verify_index_tablerE<00>dialect_optionsZ_prepared_index_nameZ format_tablerA<00>quoterRZ expressions<6E>itemsr"r<>)
ror$r<>r<>r<>r)rGZ
withclauseZ whereclauseZwhere_compiledrb)r*rorc<00>visit_create_index]sD     
  
      z PGDDLCompiler.visit_create_indexcKs<>d}|jdk r2|d|jj|<00>7}ng}xJ|jD]?\}}}d|d<|jd|jj||<00>|f<16>qBW|d|jdj|<00>f7}|j dk r<>|d|jj|j d d
<00>7}n||j
|<00>7}|S) Nr<4E>zCONSTRAINT %s Fr+z
%s WITH %szEXCLUDE USING %s (%s)z, z WHERE (%s)r!T) r<>r<>Zformat_constraintZ _render_exprs<72>appendr"r<>rGrRrIZdefine_constraint_deferrability)ror#r<>r<><00>elementsr<73>r<>r<>rbrbrc<00>visit_exclude_constraint<6E>s"
$  z&PGDDLCompiler.visit_exclude_constraintcs>g}|jd}|jd<00>}|dk r<>t|ttf<00>sO|f}n|jddj<00>fdd<00>|D<><00>d<17>n|dd kr<>|jd
<00>n |dd kr<>|jd <00>n|d r<>|d jdd<00>j<00>}|jd|<16>n|dr1|d}|jd<00>j j
|<00><16>ndj|<00>S)Nr(<00>inheritsz
INHERITS ( z, c3s!|]}<00>jj|<00>VqdS)N)r<>r/)r<>r<>)rorbrcr<><00>sz2PGDDLCompiler.post_create_table.<locals>.<genexpr>z )<29> with_oidsTz
WITH OIDSFz
WITHOUT OIDS<44> on_commit<69>_rz
ON COMMIT %s<>
tablespacez
TABLESPACE %sr<73>) r.r<>r<>r<>r<>r2rRr<>rr<>r/)rorAZ
table_optsZpg_optsr5Zon_commit_optionsZtablespace_namerb)rorc<00>post_create_table<6C>s*   # 


zPGDDLCompiler.post_create_tableN) r^r_r`r r&r'r1r4r:rbrbrbrcr's  #
 9 rcsfeZdZdd<00>Zdd<00>Zdd<00>Zdd<00>Zd d
<00>Zd d <00>Zd d<00>Z dd<00>Z
dd<00>Z dd<00>Z dd<00>Z dd<00>Zdd<00>Zdd<00>Zdd<00>Zdd <00>Zd!d"<00>Zd#d$<00>Z<00>fd%d&<00>Zd'd(<00>Zd)d*<00>Zd+d,<00>Zd-d.<00>Zd/d0<00>Zd1d2<00>Zd3d4<00>Zd5d6<00>Zd7d8<00>Z<00>S)9<>PGTypeCompilercKsdS)Nr<4E>rb)ror<>r<>rbrbrc<00>visit_TSVECTOR<4F>szPGTypeCompiler.visit_TSVECTORcKsdS)Nrerb)ror<>r<>rbrbrc<00>
visit_INET<EFBFBD>szPGTypeCompiler.visit_INETcKsdS)Nrfrb)ror<>r<>rbrbrc<00>
visit_CIDR<EFBFBD>szPGTypeCompiler.visit_CIDRcKsdS)Nrgrb)ror<>r<>rbrbrc<00> visit_MACADDR<44>szPGTypeCompiler.visit_MACADDRcKsdS)Nrhrb)ror<>r<>rbrbrc<00> visit_OID<49>szPGTypeCompiler.visit_OIDcKs#|js dSdi|jd6SdS)NrzFLOAT(%(precision)s)rn)rn)ror<>r<>rbrbrc<00> visit_FLOAT<41>s zPGTypeCompiler.visit_FLOATcKsdS)NzDOUBLE PRECISIONrb)ror<>r<>rbrbrc<00>visit_DOUBLE_PRECISION<4F>sz%PGTypeCompiler.visit_DOUBLE_PRECISIONcKsdS)Nrrb)ror<>r<>rbrbrc<00> visit_BIGINT<4E>szPGTypeCompiler.visit_BIGINTcKsdS)NZHSTORErb)ror<>r<>rbrbrc<00> visit_HSTORE<52>szPGTypeCompiler.visit_HSTOREcKsdS)NZJSONrb)ror<>r<>rbrbrc<00>
visit_JSON<EFBFBD>szPGTypeCompiler.visit_JSONcKsdS)NZJSONBrb)ror<>r<>rbrbrc<00> visit_JSONB<4E>szPGTypeCompiler.visit_JSONBcKsdS)NZ INT4RANGErb)ror<>r<>rbrbrc<00>visit_INT4RANGE<47>szPGTypeCompiler.visit_INT4RANGEcKsdS)NZ INT8RANGErb)ror<>r<>rbrbrc<00>visit_INT8RANGE<47>szPGTypeCompiler.visit_INT8RANGEcKsdS)NZNUMRANGErb)ror<>r<>rbrbrc<00>visit_NUMRANGE<47>szPGTypeCompiler.visit_NUMRANGEcKsdS)NZ DATERANGErb)ror<>r<>rbrbrc<00>visit_DATERANGE<47>szPGTypeCompiler.visit_DATERANGEcKsdS)NZTSRANGErb)ror<>r<>rbrbrc<00> visit_TSRANGE<47>szPGTypeCompiler.visit_TSRANGEcKsdS)NZ TSTZRANGErb)ror<>r<>rbrbrc<00>visit_TSTZRANGE<47>szPGTypeCompiler.visit_TSTZRANGEcKs|j||<00>S)N)<01>visit_TIMESTAMP)ror<>r<>rbrbrc<00>visit_datetimeszPGTypeCompiler.visit_datetimec sD|j s|jj r0tt|<00>j||<00>S|j||<00>SdS)N)Z native_enumr<6D>r<>rlr;<00>
visit_enum<EFBFBD>
visit_ENUM)ror<>r<>)rprbrcrOszPGTypeCompiler.visit_enumcKs|jjj|<00>S)N)r<><00>identifier_preparerr%)ror<>r<>rbrbrcrP szPGTypeCompiler.visit_ENUMcKs@dt|dd<00>r"d|jp%d|jr4dp7ddfS)NzTIMESTAMP%s %srnz(%d)r<><00>WITH<54>WITHOUTz
TIME ZONE)<03>getattrrnrk)ror<>r<>rbrbrcrM s zPGTypeCompiler.visit_TIMESTAMPcKs@dt|dd<00>r"d|jp%d|jr4dp7ddfS)Nz TIME%s %srnz(%d)r<>rRrSz
TIME ZONE)rTrnrk)ror<>r<>rbrbrc<00>
visit_TIMEs zPGTypeCompiler.visit_TIMEcKs"|jdk rd|jSdSdS)Nz INTERVAL(%d)rr)rn)ror<>r<>rbrbrc<00>visit_INTERVALs zPGTypeCompiler.visit_INTERVALcKsF|jr5d}|jdk rB|d|j7}qBn d|j}|S)Nz BIT VARYINGz(%d)zBIT(%d))r<>r<>)ror<>r<>Zcompiledrbrbrc<00> visit_BIT s   zPGTypeCompiler.visit_BITcKsdS)Nrrb)ror<>r<>rbrbrc<00>
visit_UUID)szPGTypeCompiler.visit_UUIDcKs|j||<00>S)N)<01> visit_BYTEA)ror<>r<>rbrbrc<00>visit_large_binary,sz!PGTypeCompiler.visit_large_binarycKsdS)Nr]rb)ror<>r<>rbrbrcrY/szPGTypeCompiler.visit_BYTEAcKs0|j|j<00>d|jdk r*|jndS)Nz[]r)r<>r<>r<>)ror<>r<>rbrbrc<00> visit_ARRAY2szPGTypeCompiler.visit_ARRAY)r^r_r`r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrNrOrPrMrUrVrWrXrZrYr[rbrb)rprcr;<00>s8                          r;c@s1eZdZeZdd<00>Zddd<00>ZdS)<07>PGIdentifierPreparercCs<|d|jkr8|dd<00>j|j|j<00>}n|S)Nrr<00><><EFBFBD><EFBFBD><EFBFBD>)Z initial_quoter<65>Zescape_to_quoteZ escape_quote)ror<>rbrbrc<00>_unquote_identifier<s%z(PGIdentifierPreparer._unquote_identifierTcCsm|jstjd<00><00>n|j|j<00>}|j ri|ri|jdk ri|j|j<00>d|}n|S)Nz%Postgresql ENUM type requires a name.<2E>.)r<>rrr/Z omit_schemarZ quote_schema)ror<>r r<>rbrbrcr%Bs  z PGIdentifierPreparer.format_typeN)r^r_r`<00>RESERVED_WORDSZreserved_wordsr^r%rbrbrbrcr\8s  r\c@sIeZdZdd<00>Zddd<00>Zddd<00>Zddd <00>ZdS)
<EFBFBD> PGInspectorcCstjj||<00>dS)N)r <00> Inspectorrm)ro<00>connrbrbrcrmNszPGInspector.__init__NcCs"|jj|j||d|j<00>S)z(Return the OID for the given table name.<2E>
info_cache)r<><00> get_table_oidr<64>rd)ro<00>
table_namerrbrbrcreQszPGInspector.get_table_oidcCs%|p |j}|jj|j|<00>S)aKReturn 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
)<04>default_schema_namer<65><00> _load_enumsr<73>)rorrbrbrc<00> get_enumsWszPGInspector.get_enumscCs%|p |j}|jj|j|<00>S)aReturn 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
)rgr<><00>_get_foreign_table_namesr<73>)rorrbrbrc<00>get_foreign_table_namesls
z#PGInspector.get_foreign_table_names)r^r_r`rmrerirkrbrbrbrcraLs  rac@seZdZdZdS)r<>Zcreate_enum_typeN)r^r_r`rarbrbrbrcr<>zs r<>c@seZdZdZdS)r<>Zdrop_enum_typeN)r^r_r`rarbrbrbrcr<>~s r<>cs.eZdZdd<00>Z<00>fdd<00>Z<00>S)<05>PGExecutionContextcCs#|jd|jjj|<00>|<00>S)Nzselect nextval('%s'))<04>_execute_scalarr<72>rQr)rorr<>rbrbrc<00> fire_sequence<63>sz PGExecutionContext.fire_sequencecsz|jrd||jjkrd|jrM|jjrM|jd|jj|j<00>S|jdkst|jj rd|jj
rdy |j }Wn<57>t k
r|jj }|j }|ddtddt|<00><18><17>}|ddtddt|<00><18><17>}d||f}||_ }YnX|jj}|dk rAd||f}n d|f}|j||j<00>Sntt|<00>j|<00>S)Nz select %sr<00>z %s_%s_seqzselect nextval('"%s"."%s"')zselect nextval('"%s"'))rrArZserver_defaultZ has_argumentrm<00>argr<67>rZ is_sequencerZ_postgresql_seq_name<6D>AttributeErrorr<72><00>maxrrrlrl<00>get_insert_default)ror"Zseq_name<6D>tabrr<><00>schr)rprbrcrs<00>s4  

      ''  
z%PGExecutionContext.get_insert_default)r^r_r`rnrsrbrb)rprcrl<00>s  rlcsDeZdZdZdZdZdZdZdZdZ dZ
dZ dZ dZ dZdZdZdZeZeZeZeZeZeZeZeZdZ e!j"idd6dd6id 6dd
6id 6fe!j#idd 6dd 6dd6dd6dd6fgZ$dTZ%dZ&ddddd<00>Z'<00>fdd<00>Z(dd<00>Z)e*ddddg<00>Z+dd<00>Z,dd<00>Z-d d!<00>Z.d"d#<00>Z/ddd$d%<00>Z0ddd&d'<00>Z1d(d)<00>Z2d*d+<00>Z3d,d-<00>Z4dd.d/<00>Z5dd0d1<00>Z6dd2d3<00>Z7d4d5<00>Z8e9j:dd6d7<00><00>Z;e9j:d8d9<00><00>Z<e9j:dd:d;<00><00>Z=e9j:dd<d=<00><00>Z>e9j:dd>d?<00><00>Z?e9j:dd@dA<00><00>Z@e9j:ddBdC<00><00>ZAdDdE<00>ZBe9j:ddFdG<00><00>ZCe9j:dddHdI<00><00>ZDdJdK<00>ZEe9j:dLdM<00><00>ZFe9j:ddNdO<00><00>ZGddPdQ<00>ZHdRdS<00>ZI<00>S)U<> PGDialectr(T<>?FZpyformatNrGrIr*r)rJZignore_search_pathr9r6r7r5<00>postgresql_ignore_search_pathcKs2tjj||<00>||_||_||_dS)N)r<00>DefaultDialectrm<00>isolation_levelZ_json_deserializerZ_json_serializer)rorzZjson_serializerZjson_deserializerr<72>rbrbrcrm<00>s  zPGDialect.__init__cs<>tt|<00>j|<00>|jd ko7|jjdd<00>|_|jd
k|_|js<>|jj <00>|_|jj
t j d<00>|jj
t d<00>n|jd k|_|jd kp<>|jd<00>dk|_dS) N<>r<00>implicit_returningTr<00> z show standard_conforming_stringsr9)r{r)r{r)r}r)r{r)rlrv<00>
initialize<EFBFBD>server_version_info<66>__dict__r<5F>r|r<><00>colspecs<63>copyr<79>rv<00>Enumr<6D>r<00>scalarr<72>)ro<00>
connection)rprbrcr~<00>s zPGDialect.initializecs-<00>jdk r%<00>fdd<00>}|SdSdS)Ncs<00>j|<00>j<00>dS)N)<02>set_isolation_levelrz)rc)rorbrc<00>connectsz%PGDialect.on_connect.<locals>.connect)rz)ror<>rb)rorc<00>
on_connectszPGDialect.on_connectZ SERIALIZABLEzREAD UNCOMMITTEDzREAD COMMITTEDzREPEATABLE READcCs<>|jdd<00>}||jkrOtjd||jdj|j<00>f<16><00>n|j<00>}|jd|<16>|jd<00>|j<00>dS)Nr8rzLInvalid value '%s' for isolation_level. Valid isolation levels for %s are %sz, z=SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL %sZCOMMIT) r<><00>_isolation_lookupr<00> ArgumentErrorr<72>rR<00>cursorr<72><00>close)ror<><00>levelr<6C>rbrbrcr<> s%  zPGDialect.set_isolation_levelcCs=|j<00>}|jd<00>|j<00>d}|j<00>|j<00>S)Nz show transaction isolation levelr)r<>r<>Zfetchoner<65>r)ror<>r<><00>valrbrbrc<00>get_isolation_levels
  
zPGDialect.get_isolation_levelcCs|j|j<00>dS)N)Zdo_beginr<6E>)ror<><00>xidrbrbrc<00>do_begin_twophase!szPGDialect.do_begin_twophasecCs|jd|<16>dS)NzPREPARE TRANSACTION '%s')r<>)ror<>r<>rbrbrc<00>do_prepare_twophase$szPGDialect.do_prepare_twophasecCsa|rM|r|jd<00>n|jd|<16>|jd<00>|j|j<00>n|j|j<00>dS)N<>ROLLBACKzROLLBACK PREPARED '%s'<27>BEGIN)r<><00> do_rollbackr<6B>)ror<>r<><00> is_prepared<65>recoverrbrbrc<00>do_rollback_twophase's zPGDialect.do_rollback_twophasecCsa|rM|r|jd<00>n|jd|<16>|jd<00>|j|j<00>n|j|j<00>dS)Nr<4E>zCOMMIT PREPARED '%s'r<>)r<>r<>r<>Z do_commit)ror<>r<>r<>r<>rbrbrc<00>do_commit_twophase6s zPGDialect.do_commit_twophasecCs)|jtjd<00><00>}dd<00>|D<>S)Nz!SELECT gid FROM pg_prepared_xactscSsg|]}|d<19>qS)rrb)r<><00>rowrbrbrcr<>Ds z1PGDialect.do_recover_twophase.<locals>.<listcomp>)r<>rr<>)ror<>Z resultsetrbrbrc<00>do_recover_twophaseAszPGDialect.do_recover_twophasecCs |jd<00>S)Nzselect current_schema())r<>)ror<>rbrbrc<00>_get_default_schema_nameFsz"PGDialect._get_default_schema_namec Cs[d}|jtj|dtjdtj|j<00><00>dtj<00>g<00><01>}t |j
<00><00>S)Nz=select nspname from pg_namespace where lower(nspname)=:schema<6D>
bindparamsrr<>) r<>rr<><00> bindparamrr<><00>lowerrv<00>Unicode<64>bool<6F>first)ror<>r<00>queryr<79>rbrbrc<00>
has_schemaIszPGDialect.has_schemac
Cs<>|dkrN|jtjddtjdtj|<00>dtj<00>g<00><01>}n`|jtjddtjdtj|<00>dtj<00>tjdtj|<00>dtj<00>g<00><01>}t|j <00><00>S)Nz<4E>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=:namer<65>r<>r<>ztselect relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where n.nspname=:schema and relname=:namer)
r<EFBFBD>rr<>r<>rr<>rvr<>r<>r<>)ror<>rfrr<>rbrbrc<00> has_tableXs     zPGDialect.has_tablec
Cs<>|dkrN|jtjddtjdtj|<00>dtj<00>g<00><01>}n`|jtjddtjdtj|<00>dtj<00>tjdtj|<00>dtj<00>g<00><01>}t|j <00><00>S)Nz<4E>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=:namer<65>r<>r<>z<>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<EFBFBD>rr<>r<>rr<>rvr<>r<>r<>)ror<>Z sequence_namerr<>rbrbrc<00> has_sequencews   zPGDialect.has_sequencecCs<>|dk r$d}tj|<00>}nd}tj|<00>}|jtjdtj|<00>dtj<00><01>}|dk r<>|jtjdtj|<00>dtj<00><01>}n|j|<00>}t |j
<00><00>S)Na 
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
)
z<>
SELECT EXISTS (
SELECT * FROM pg_catalog.pg_type t
WHERE t.typname = :typname
AND pg_type_is_visible(t.oid)
)
Ztypnamer<65>Znspname) rr<>r<>r<>rr<>rvr<>r<>r<>r<>)ror<>Z type_namerr<>r<>rbrbrcr<><00>s    !zPGDialect.has_typecCsf|jd<00>j<00>}tjd|<00>}|s@td|<16><00>ntdd<00>|jddd<00>D<><00>S) Nzselect version()zJ.*(?:PostgreSQL|EnterpriseDB) (\d+)\.(\d+)(?:\.(\d+))?(?:\.\d+)?(?:devel)?z,Could not determine version from string '%s'cSs(g|]}|dk rt|<00><00>qS)N)<01>int)r<>r<>rbrbrcr<><00>s z6PGDialect._get_server_version_info.<locals>.<listcomp>rrr)r<>r<><00>re<72>match<63>AssertionErrorr<72>r/)ror<><00>v<>mrbrbrc<00>_get_server_version_info<66>s z"PGDialect._get_server_version_infoc
Ks<>d}|dk rd}nd}d|}tj|<00>}|dk rXtj|<00>}ntj|<00>jdtj<00>}|jdtj<00>}|r<>|jtj ddtj<00><01>}n|j
|d|d|<00>} | j <00>}|dkr<>t j |<00><00>n|S) z<>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.
Nzn.nspname = :schemaz%pg_catalog.pg_table_is_visible(c.oid)z<>
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')
rfr<>rr<>)rr<>rr<>r<>rvr<>r<00>Integerr<72>r<>r<>rZNoSuchTableError)
ror<>rfrr<><00> table_oidZschema_where_clauser<65>rr
rbrbrcre<00>s"   
 $  zPGDialect.get_table_oidc sQd}|j|<00>}tjr:<00>fdd<00>|D<>}ndd<00>|D<>}|S)NzS
SELECT nspname
FROM pg_namespace
ORDER BY nspname
cs9g|]/}|djd<00>s|dj<00>j<00><00>qS)r<00>pg_)<03>
startswith<EFBFBD>decode<64>encoding)r<>r<>)rorbrcr<><00>s z.PGDialect.get_schema_names.<locals>.<listcomp>cSs-g|]#}|djd<00>s|d<19>qS)rr<>)r<>)r<>r<>rbrbrcr<><00>s )r<>r<00>py2k)ror<>r<>r<00>rpZ schema_namesrb)rorc<00>get_schema_names<65>s  zPGDialect.get_schema_namescKs[|dk r|}n |j}|jtjd|ditjd6<><01>}dd<00>|D<>S)Nz<4E>SELECT relname FROM pg_class c WHERE relkind = 'r' AND '%s' = (select nspname from pg_namespace n where n.oid = c.relnamespace) <20>typemap<61>relnamecSsg|]}|d<19>qS)rrb)r<>r<>rbrbrcr<> s z-PGDialect.get_table_names.<locals>.<listcomp>)rgr<>rr<>rvr<>)ror<>rr<>rM<00>resultrbrbrc<00>get_table_names<65>s    zPGDialect.get_table_namescKs[|dk r|}n |j}|jtjd|ditjd6<><01>}dd<00>|D<>S)Nz<4E>SELECT relname FROM pg_class c WHERE relkind = 'f' AND '%s' = (select nspname from pg_namespace n where n.oid = c.relnamespace) r<>r<>cSsg|]}|d<19>qS)rrb)r<>r<>rbrbrcr<> s z6PGDialect._get_foreign_table_names.<locals>.<listcomp>)rgr<>rr<>rvr<>)ror<>rr<>rMr<>rbrbrcrj
s    z"PGDialect._get_foreign_table_namesc s|dk r|}n <00>j}dtd|<00>}tjr_<00>fdd<00>|j|<00>D<>}ndd<00>|j|<00>D<>}|S)Nz<4E>
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)
rcs&g|]}|dj<00>j<00><00>qS)r)r<>r<>)r<>r<>)rorbrcr<>+ s z,PGDialect.get_view_names.<locals>.<listcomp>cSsg|]}|d<19>qS)rrb)r<>r<>rbrbrcr<>. s )rg<00>dictrr<>r<>)ror<>rr<>rMrZ
view_namesrb)rorc<00>get_view_names s    zPGDialect.get_view_namesc Ks<>|dk r|}n |j}d}|jtj|<00>d|d|<00>}|r<>tjrr|j<00>j|j<00>}n |j<00>}|SdS)Nzv
SELECT definition FROM pg_views
WHERE schemaname = :schema
AND viewname = :view_name
<20> view_namer) rgr<>rr<>rr<>r<>r<>r<>) ror<>r<>rr<>rMrr<>Zview_defrbrbrc<00>get_view_definition1 s     zPGDialect.get_view_definitionc Ks!|j|||d|jd<00><00>}d}tj|dtjddtj<00>gditjd6tjd6<>}|j|d|<00>}|j <00>} |j
|<00>}
t d d
<00>|j |d d <00>D<><00>} g} xN| D]F\} }}}}}|j | ||||
| |<00>}| j|<00>q<>W| S) Nrda6
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
r<>r<>r<>r<><00>attnamercssA|]7}|ds+d|d|dfn|d|fVqdS)<05>visiblez%s.%srr<>Nrb)r<>Zrecrbrbrcr<>c sz(PGDialect.get_columns.<locals>.<genexpr>r<00>*)rer<>rr<>r<>rvr<>r<>r<><00>fetchall<6C> _load_domainsr<73>rh<00>_get_column_infor2)ror<>rfrr<>r<>ZSQL_COLSrr
<00>rows<77>domainsr<73>rr<>r%rrTZattnum<75> column_inforbrbrc<00> get_columnsE s( 
  zPGDialect.get_columnsc Cs
tjdd|<00>}tjdd|<00>}| } |jd<00>}
tjd|<00>} | rj| jd<00>} ntjd|<00>} | r<>| jd<00>r<>ttjd| jd<00><00><00>} nf} i} |d kr | r| jd
<00>\}}t|<00>t|<00>f} q#f} n|d kr!d+} n|d kr6f} n<>|d,krnd| d<| ret| <00>| d<nf} n<>|d-kr<>d| d<| r<>t| <00>| d<nf} n}|dkr<>d| d<| r<>t| <00>f} q#f} nF|d.kr | rt| <00>| d<nf} n| r#t| <00>f} nx<>||jkrF|j|}Pq&||kr<>||}t }|d| d<|ds<>|d| d<nt|d<19>} Pq&||kr<>||}|d }|d!} |d"r&| r&|d"}q&q&q&d}Pq&|r$|| | <00>}|
rDt
|<00>}qDn t j d#||f<16>t j}d}|dk r<>tjd$|<00>}|dk r<>d}|}d%|jd&<00>kr<>|dk r<>|jd<00>d'|d%|jd&<00>|jd(<00>}q<>q<>ntd|d)|d!| d"|d*|<00>}|S)/Nz\(.*\)r<>z\[\]z[]z \(([\d,]+)\)rz\((.*)\)z\s*,\s*r<><00>,zdouble precision<6F>5r<><00>timestamp with time zone<6E>time with time zoneTrkrn<00>timestamp without time zone<6E>time without time zoner<65>Fz bit varyingr<67>rt<00>interval year to month<74>interval day to secondr<64>r<>r<00>labels<6C>attyperrz*Did not recognize type '%s' of column '%s'z(nextval\(')([^']+)('.*$)r_rz"%s"rr<><00> autoincrement)r<>)r<>r<>)r<>r<>ztime)zintervalr<6C>r<>)r<><00>sub<75>endswith<74>searchr/r<><00>splitr<74><00> ischema_namesr<73>r<>r<00>warnrvr<>r<>)ror<>r%rrTr<>r<>rr<>rZis_arrayZcharlen<65>argsr<73>ZprecZscaler<65><00>enum<75>domainr<6E>r<>rur<>rbrbrcr<>q s<>$       
  
  
     

 


     !>zPGDialect._get_column_infoc Ks<>|j|||d|jd<00><00>}|jdkrLd|jdd<00>}nd}tj|ditjd 6<>}|j|d
|<00>}d d <00>|j <00>D<>} d }
tj|
ditjd6<>}|j|d
|<00>}|j
<00>} i| d6| d6S)Nrdr{<00>aq
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
za.attnumz ix.indkeya<79>
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<>r<>r<>cSsg|]}|d<19>qS)rrb)r<><00>rrbrbrcr<>
s z/PGDialect.get_pk_constraint.<locals>.<listcomp>z<>
SELECT conname
FROM pg_catalog.pg_constraint r
WHERE r.conrelid = :table_oid AND r.contype = 'p'
ORDER BY 1
<20>conname<6D>constrained_columnsr<73>)r{r<>) rer<>r<00> _pg_index_anyrr<>rvr<>r<>r<>r<>) ror<>rfrr<>r<>ZPK_SQL<51>tr
<00>colsZ PK_CONS_SQLr<4C>rbrbrc<00>get_pk_constraint<6E> s  zPGDialect.get_pk_constraintc s/|j<00>|j|||d|jd<00><00>}d}tjd<00>}tj|ditjd6tjd6<>} |j | d|<00>}
g} x<>|
j
<00>D]<5D>\} } }tj || <00>j <00>}|\ }}}}}}}}}}}}}|dk r|dkrd nd
}n<00>fd d <00>tj d |<00>D<>}|rZ||jkrQ|}q<>|}n9|rr<01>j|<00>}n!|dk r<>||kr<>|}n<00>j|<00>}<00>fdd <00>tj d|<00>D<>}i| d6|d6|d6|d6|d6i|d6|d6|d6|d6|d6d6}| j|<00>q<>W| S)Nrda<>
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
a/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<>r<><00>condefrAZ
DEFERRABLETFcsg|]}<00>j|<00><00>qSrb)r^)r<>r<>)r<>rbrcr<>@
s z.PGDialect.get_foreign_keys.<locals>.<listcomp>z\s*,\s*csg|]}<00>j|<00><00>qSrb)r^)r<>r<>)r<>rbrcr<>W
s z\s*,\sr<73>r<><00>referred_schema<6D>referred_table<6C>referred_columns<6E>onupdate<74>ondeleter&r1r<><00>options)rQrer<>r<><00>compilerr<>rvr<>r<>r<>r<><00>groupsr<73>rgr^r2)ror<>rfrrxr<>r<>ZFK_SQLZFK_REGEXr<58>r
Zfkeysr<73>r<>Z conschemar<61>r<>r<>r<>r<>r8r<>r<>r<>r&r1Zfkey_drb)r<>rc<00>get_foreign_keys
sX 

-    zPGDialect.get_foreign_keyscsQ|jd
kr?ddj<00><00>fdd<00>tdd<00>D<><00>Sd <00><00>fSdS) Nr{rz(%s)z OR c3s"|]}d<00>|<00>fVqdS)z %s[%d] = %sNrb)r<><00>ind)r<00>
compare_torbrcr<>t
sz*PGDialect._pg_index_any.<locals>.<genexpr>r<00>
z %s = ANY(%s))r{r)rrR<00>range)rorr<>rb)rr<>rcr<>k
s
 zPGDialect._pg_index_anyc s|j|||d|jd<00><00>}|jd%krd|jd&krKdnd|jd'krcd nd
|jd d <00>f}nd }tj|ditjd6<>}|j|d|<00>}t dd<00><00>} d}
xX|j
<00>D]J} | \
} } }}}}}}}}|r:| |
kr.t j d| <16>n| }
q<>n|rg| |
k rgt j d| <16>| }
n| | k}| | }|dk r<>||d|<n|s<>dd<00>|j <00>D<>|d<| |d<|dk r<>| |d<n|rtdd<00>|D<><00>|d<n|r(|dkr(||d<q(q<>q<>Wg}x<>| j<00>D]<5D>\}<00>i|d6<>dd6<>fd d<00><00>dD<>d!6}d<00>kr<><02>d|d<nd<00>kr<><02>d|jd"i<00>d#<nd<00>kr<><02>d|jd"i<00>d$<n|j|<00>q?W|S)(Nrdr{<00>a<>
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
rz ::varcharr<72>rz i.reloptionsZNULLza.attnumz ix.indkeya<79>
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<>r<>r<>cSs
tt<00>S)N)rr<>rbrbrbrc<00><lambda><3E>
sz'PGDialect.get_indexes.<locals>.<lambda>z;Skipped unsupported reflection of expression-based index %sz7Predicate of partial index %s ignored during reflectionr<6E>cSs"g|]}t|j<00><00><00>qSrb)r<><00>strip)r<><00>krbrbrcr<><00>
s z)PGDialect.get_indexes.<locals>.<listcomp>r,rEZduplicates_constraintcSsg|]}|jd<00><00>qS)<01>=)r<>)r<><00>optionrbrbrcr<><00>
s r<>Zbtree<65>amnamer<65>csg|]}<00>d|<19>qS)r<>rb)r<><00>i)<01>idxrbrcr<><00>
s <00> column_namesr.Zpostgresql_withZpostgresql_using)r{r<>)r{r)r{r)rer<>rr<>rr<>rvr<>r<>rr<>rr<>r<>r<>r0<00>
setdefaultr2)ror<>rfrr<>r<>ZIDX_SQLr<4C>r
<00>indexesZ sv_idx_namer<65>Zidx_namerEr<>Zprdr<00>col_numZconrelidZidx_keyr<79>r<>Zhas_idxr<78>r<>r<><00>entryrb)r<>rc<00> get_indexesz
sn$    
 
   !   zPGDialect.get_indexesc Ks<>|j|||d|jd<00><00>}d}tj|ditjd6<>}|j|d|<00>}tdd<00><00>} xB|j<00>D]4}
| |
j } |
j
| d<|
j | d |
j <q}Wd
d <00>| j <00>D<>S) Nrda<>
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<><00>col_namer<65>cSs
tt<00>S)N)rr<>rbrbrbrcr<> sz2PGDialect.get_unique_constraints.<locals>.<lambda>r,r<>csAg|]7\}<00>i|d6<>fdd<00><00>dD<>d6<>qS)r<>csg|]}<00>d|<19>qS)r<>rb)r<>r<>)<01>ucrbrcr<>" s z?PGDialect.get_unique_constraints.<locals>.<listcomp>.<listcomp>r,r<>rb)r<>r<>rb)rrcr<>! s z4PGDialect.get_unique_constraints.<locals>.<listcomp>)rer<>rr<>rvr<>r<>rr<>r<>r,rr<>r0) ror<>rfrr<>r<>Z
UNIQUE_SQLr<EFBFBD>r
Zuniquesr<73>rrbrbrc<00>get_unique_constraints s   z PGDialect.get_unique_constraintsc CsK|p |j}|jsiSd}|dkr;|d7}n|d7}tj|ditjd6tjd6<>}|dkr<>|jd|<00>}n|j|<00>}g}i}x<>|j<00>D]<5D>}|d|d f} | |kr<>|| d
j |d<19>q<>i|d d 6|dd6|d d 6|dgd
6|| <}
|j |
<00>q<>W|S) Na<4E>
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'
r<>zAND n.nspname = :schema z ORDER BY "schema", "name", e.oidr<64>r<><00>labelrr<>r<>r<>)
rgr<>rr<>rvr<>r<>r<>r<>r2) ror<>rZ SQL_ENUMSrr
r<>Z enum_by_namer<65>r,Zenum_recrbrbrcrh& s4   

     zPGDialect._load_enumsc Cs<>d}tj|ditjd6<>}|j|<00>}i}x<>|j<00>D]{}tjd|d<19>jd<00>}|dr<>|d}nd |d
|df}i|d6|d d 6|d d 6||<qGW|S) Na<4E>
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<>r<>z([^\(]+)r<>rr<>r<>z%s.%srrr) rr<>rvr<>r<>r<>r<>r<>r/) ror<>Z SQL_DOMAINSrr
r<>r<>r<>r<>rbrbrcr<>Y s 
  zPGDialect._load_domains)zpostgresql_ignore_search_path)Jr^r_r`r<>Zsupports_alterZmax_identifier_lengthZsupports_sane_rowcountr<74>Zsupports_native_booleanrZsupports_sequencesZsequences_optionalZ"preexecute_autoincrement_sequencesZpostfetch_lastrowidZsupports_default_valuesZsupports_empty_insertZsupports_multivalues_insertZdefault_paramstyler<65>r<>r<>Zstatement_compilerrZ ddl_compilerr;rr\r<>rlZexecution_ctx_clsraZ inspectorrzr<00>IndexZTableZconstruct_argumentsZreflection_optionsr<73>rmr~r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r <00>cacherer<>r<>rjr<>r<>r<>r<>r<>r<>r<>rrrhr<>rbrb)rprcrv<00>s<>  
       
    #+ o/Y <15>#3rv)]ri<00> collectionsrr<><00>datetimeryr<>rrrrZenginerr r
r r r rrvr<>rr<><00> ImportErrorZsqlalchemy.typesrrrrrrrrrrrr<>r`Z_DECIMAL_TYPESZ _FLOAT_TYPESZ
_INT_TYPESZ LargeBinaryr]ZFloatrdZ
TypeEnginereZPGInetrfZPGCidrrgZ PGMacAddrrhrjrqrrZ
PGIntervalr~ZPGBitZPGUuidr<64>Z ColumnElementr<74>r<>r<>ZTuplerr<>r<>ZPGArrayr<79>r<>rwr<><00>Stringr<67>Z SQLCompilerr<72>Z DDLCompilerrZGenericTypeCompilerr;ZIdentifierPreparerr\rbraZ_CreateDropBaser<65>r<>ZDefaultExecutionContextrlryrvrbrbrbrc<00><module>6s<>  ""  L   
 2 3<1F>3<19>
 


<19><19>o.0