catalog between different versions.
This is handy for creating tools that need to work across multiple versions of Postgres. It is especially useful in supporting code generation based on catalog metadata.
catalog_entities depends on the cat_tools extension. The simplest way to install it is:
# Install pgxn if it doesn't exist
which pgxn > /dev/null || sudo -H pip install pgxnclient
# Now install cat_tools
pgxn install cat_tools
load.sh
will create a new Postgres database with full catalog information. It
requires the name of a database. It also accepts any psql options that also
work with dropdb and createdb.
Warning
|
load.sh will drop the specified database if it already exists! |
Example:
./load.sh catalog_entities
catalog_relations
is the raw table that contains catalog attribute
information for each version.
latest
lists information for the most recent version in catalog_relations
.
latest_expanded
explodes the attribute information, providing one row for
every attribute in every relation, instead of one row per relation.
current_version_delta
and current_version_relation
both inspect the catalog
tables in the database. These are "live" and their contents depend on the
version of Postgres that the database is running in. They are used by other
scripts to update catalog_relations
.