# SQLAlchemy 0.4 Documentation

Multiple Pages | One Page
Version: 0.4.4 Last Updated: 03/11/08 20:04:34

### module sqlalchemy.databases.postgres

Support for the PostgreSQL database.

PostgreSQL supports partial indexes. To create them pass a posgres_where option to the Index constructor:

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

PostgreSQL 8.2+ supports returning a result set from inserts and updates. To use this pass the column/expression list to the postgres_returning parameter when creating the queries:

    raises = tbl.update(empl.c.sales > 100, values=dict(salary=empl.c.salary * 1.1),
      postgres_returning=[empl.c.id, empl.c.salary]).execute().fetchall()

### Module Functions

def descriptor()

### class PGArray(MutableType,Concatenable,TypeEngine)

def __init__(self, item_type, mutable=True)

Construct a new `PGArray`.

def bind_processor(self, dialect)
def compare_values(self, x, y)
def copy_value(self, value)
def dialect_impl(self, dialect, **kwargs)
def get_col_spec(self)
def is_mutable(self)
def result_processor(self, dialect)
back to section top

### class PGBigInteger(PGInteger)

def get_col_spec(self)
back to section top

### class PGBinary(Binary)

def get_col_spec(self)
back to section top

### class PGBoolean(Boolean)

def get_col_spec(self)
back to section top

### class PGChar(CHAR)

def get_col_spec(self)
back to section top

### class PGCompiler(DefaultCompiler)

def for_update_clause(self, select)
def get_select_precolumns(self, select)
def limit_clause(self, select)
def visit_insert(self, insert_stmt)
def visit_sequence(self, seq)
def visit_update(self, update_stmt)
back to section top

### class PGDate(Date)

def get_col_spec(self)
back to section top

### class PGDateTime(DateTime)

def get_col_spec(self)
back to section top

### class PGDefaultRunner(DefaultRunner)

def get_column_default(self, column, isinsert=True)
def visit_sequence(self, seq)
back to section top

### class PGDialect(DefaultDialect)

def __init__(self, use_oids=False, server_side_cursors=False, **kwargs)

Construct a new `PGDialect`.

def create_connect_args(self, url)
def create_execution_context(self, *args, **kwargs)
def dbapi(cls)
def do_begin_twophase(self, connection, xid)
def do_commit_twophase(self, connection, xid, is_prepared=True, recover=False)
def do_prepare_twophase(self, connection, xid)
def do_recover_twophase(self, connection)
def do_rollback_twophase(self, connection, xid, is_prepared=True, recover=False)
def get_default_schema_name(self, connection)
def has_sequence(self, connection, sequence_name)
def has_table(self, connection, table_name, schema=None)
def is_disconnect(self, e)
def last_inserted_ids(self)
def oid_column_name(self, column)
def reflecttable(self, connection, table, include_columns)
def server_version_info(self, connection)
def table_names(self, connection, schema)
def type_descriptor(self, typeobj)
back to section top

### class PGExecutionContext(DefaultExecutionContext)

def create_cursor(self)
def get_result_proxy(self)
def post_exec(self)
def returns_rows_compiled(self, compiled)
def returns_rows_text(self, statement)
back to section top

### class PGFloat(Float)

def get_col_spec(self)
back to section top

### class PGIdentifierPreparer(IdentifierPreparer)

back to section top

### class PGInet(TypeEngine)

def get_col_spec(self)
back to section top

### class PGInteger(Integer)

def get_col_spec(self)
back to section top

### class PGInterval(TypeEngine)

def get_col_spec(self)
back to section top

### class PGMacAddr(TypeEngine)

def get_col_spec(self)
back to section top

### class PGNumeric(Numeric)

def bind_processor(self, dialect)
def get_col_spec(self)
def result_processor(self, dialect)
back to section top

### class PGSchemaDropper(SchemaDropper)

def visit_sequence(self, sequence)
back to section top

### class PGSchemaGenerator(SchemaGenerator)

def get_column_specification(self, column, **kwargs)
def visit_index(self, index)
def visit_sequence(self, sequence)
back to section top

### class PGSmallInteger(SmallInteger)

def get_col_spec(self)
back to section top

### class PGString(String)

def get_col_spec(self)
back to section top

### class PGText(Text)

def get_col_spec(self)
back to section top

### class PGTime(Time)

def get_col_spec(self)
back to section top