cat_tools 0.1.2

This Release
cat_tools 0.1.2
Date
Status
Stable
Latest Stable
cat_tools 0.2.1 —
Other Releases
Abstract
Tools for interfacing with the Postgres catalog
Released By
decibel
License
MIT
Resources
Special Files
Tags

Extensions

cat_tools 0.1.1
Tools for interfacing with the catalog

Documentation

HISTORY
HISTORY

README

Cat Tools

These are tools that make it easier to interface with the Postgres catalog tables/views/functions. They are meant for use by code, not by people.

To make use of them, you need to grant cat_tools__usage to any roles that need access.

Current Status

PGXN version Build Status

This is very much a work in progress. If it doesn’t do something you need, please open an issue!

Supported Versions

Works on Postgres 9.3 and above.

Functions

  • cat_tools.currval(table, column) - Returns current value for a sequence owned by a column

  • cat_tools.enum_range(regtype) - Returns valid values for an ENUM as an array

  • cat_tools.enum_range_srf(regtype) - Returns valid values for an ENUM as a recordset

  • cat_tools.name__check(text) - Throws an error if input would be truncated when cast to name

  • cat_tools.pg_class(relation regclass) - Returns cat_tools.pg_class_v row for a relation

  • cat_tools.trigger__parse(trigger oid) - Returns information about a trigger

  • cat_tools.trigger__get_oid(trigger_table, trigger_name) - oid of a trigger. Throws error if trigger doesn’t exits.

  • cat_tools.trigger__get_oid__loose(trigger_table, trigger_name) - oid of a trigger. Does not throw error if trigger doesn’t exits.

Views

Warning
These views may eventually move into a separate extension!
  • cat_tools.pg_class_v - Joins pg_class to pg_namespace

  • cat_tools.column - Returns data about columns

  • cat_tools.pg_all_foreign_keys - Data about foreign keys

Copyright and License

PandaPost is released under a MIT liscense.

Copyright (c) 2016 Jim Nasby <Jim.Nasby@BlueTreble.com>.