trac.db.postgres_backend

class trac.db.postgres_backend.PostgreSQLConnection(path, log=None, user=None, password=None, host=None, port=None, params={})

Bases: trac.db.api.ConnectionBase, trac.db.util.ConnectionWrapper

Connection wrapper for PostgreSQL.

class trac.db.postgres_backend.PostgreSQLConnector

Bases: trac.core.Component

Database connector for PostgreSQL.

Database URLs should be of the form: {{{ postgres://user[:password]@host[:port]/database[?schema=my_schema] }}}

alter_column_types(table, columns)

Yield SQL statements altering the type of one or more columns of a table.

Type changes are specified as a columns dict mapping column names to (from, to) SQL type tuples.

pg_dump_path

Location of pg_dump for Postgres database backups

trac.db.postgres_backend.assemble_pg_dsn(path, user=None, password=None, host=None, port=None)

Quote the parameters and assemble the DSN.