NAME

DBIO::PostgreSQL::Introspect::Schemas - Introspect PostgreSQL schemas (namespaces)

VERSION

version 0.900007

DESCRIPTION

Fetches PostgreSQL schema (namespace) metadata from pg_catalog.pg_namespace. System schemas (pg_* and information_schema) are excluded, and so is a schema an installed extension owns (a pg_depend row of deptype e): one the extension's script created, which DROP EXTENSION takes with it. A schema CREATE EXTENSION itself creates because the control file names it (schema = ...) is not owned by the extension -- DROP EXTENSION leaves it behind -- and is reported like any other. The dependency runs the other way, the extension on the schema, which is why DBIO::PostgreSQL::Diff creates a schema ahead of the extensions and drops it after them ("ORDER OF OPERATIONS" in DBIO::PostgreSQL::Diff).

METHODS

fetch

my $schemas = DBIO::PostgreSQL::Introspect::Schemas->fetch($dbh, $filter);

Returns a hashref keyed by schema name. Each value is a hashref with keys oid and comment. Pass an optional ArrayRef as $filter to restrict to specific schema names.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.