Skip to content

Entities that exist in various versions of the Postgres catalog

License

Notifications You must be signed in to change notification settings

nasbyj/catalog_entities

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

catalog between different versions.

Why would I wast this?

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.

Installing

Dependencies

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

Install

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

Provided data

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.

About

Entities that exist in various versions of the Postgres catalog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 57.7%
  • PLpgSQL 42.3%