<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pg_enum on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/pg_enum/</link><description>Recent content in Pg_enum on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Mon, 06 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/pg_enum/index.xml" rel="self" type="application/rss+xml"/><item><title>List PostgreSQL Enum Types and Their Values with SQL</title><link>https://www.postgresscripts.com/post/list-postgresql-enum-types/</link><pubDate>Mon, 06 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/list-postgresql-enum-types/</guid><description>
&lt;h2 id="how-to-list-all-enum-types-in-a-postgresql-database"&gt;How to List All Enum Types in a PostgreSQL Database&lt;/h2&gt;
&lt;p&gt;PostgreSQL supports user-defined enum types — a fixed ordered set of string values stored efficiently as integers. Enums are common in application schemas for columns like &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;role&lt;/code&gt;, or &lt;code&gt;priority&lt;/code&gt;. Once created, their allowed values are managed in the database catalog, not in application code.&lt;/p&gt;
&lt;p&gt;Over time, a database can accumulate many enum types, some with values that no longer match what the application uses. This SQL script queries &lt;code&gt;pg_type&lt;/code&gt; and &lt;code&gt;pg_enum&lt;/code&gt; to list every enum type in the current database along with all of its allowed values.&lt;/p&gt;</description></item></channel></rss>