<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Waiting for 8.4 &#8211; pg_conf_load_time, time-related generate_series and enum values in \dT+</title>
	<atom:link href="http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 21:40:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/comment-page-1/#comment-26015</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Mon, 05 May 2008 12:01:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/?p=1200#comment-26015</guid>
		<description>@Radek Zielinski:
Because pg_enum is in system catalog. I strongly believe that user shouldn&#039;t ever need to touch it.</description>
		<content:encoded><![CDATA[<p>@Radek Zielinski:<br />
Because pg_enum is in system catalog. I strongly believe that user shouldn&#8217;t ever need to touch it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radek Zielinski</title>
		<link>http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/comment-page-1/#comment-26013</link>
		<dc:creator>Radek Zielinski</dc:creator>
		<pubDate>Mon, 05 May 2008 11:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/?p=1200#comment-26013</guid>
		<description>@depesz: Just out of curiosity, why do you consider an insert to pg_enum (yes, I know it doesn&#039;t solve the sorting problem) unacceptable?</description>
		<content:encoded><![CDATA[<p>@depesz: Just out of curiosity, why do you consider an insert to pg_enum (yes, I know it doesn&#8217;t solve the sorting problem) unacceptable?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/comment-page-1/#comment-26012</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Mon, 05 May 2008 11:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/?p=1200#comment-26012</guid>
		<description>@Radek Zielinski:
It&#039;s great to have Your comment here, but trust me - doing &quot;alter table&quot; to fix enum is not acceptable.
It gets exclusive lock on whole table for the time of processing it. Just imagine multi-hour downtime of production site, and You&#039;ll understand why it&#039;s not cool.
There are other ways that &quot;work&quot; as well - like modifying pg_catalog, but it&#039;s also not acceptable in production environment.</description>
		<content:encoded><![CDATA[<p>@Radek Zielinski:<br />
It&#8217;s great to have Your comment here, but trust me &#8211; doing &#8220;alter table&#8221; to fix enum is not acceptable.<br />
It gets exclusive lock on whole table for the time of processing it. Just imagine multi-hour downtime of production site, and You&#8217;ll understand why it&#8217;s not cool.<br />
There are other ways that &#8220;work&#8221; as well &#8211; like modifying pg_catalog, but it&#8217;s also not acceptable in production environment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radek Zielinski</title>
		<link>http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/comment-page-1/#comment-26011</link>
		<dc:creator>Radek Zielinski</dc:creator>
		<pubDate>Mon, 05 May 2008 11:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/?p=1200#comment-26011</guid>
		<description>@depesz: &quot;until there will be sane way to add and remove elements from ENUM - functionality of this data type is very limited. So limited that I honestly can’t imagine myself any situation in which I would use it.&quot;

You can create a new enum type and cast your columns to it (and recreate any functions using this type, which might get ugly).

create type e1 as enum (&#039;a&#039;, &#039;b&#039;, &#039;foo&#039;);
create type e2 as enum (&#039;a&#039;, &#039;b&#039;, &#039;c&#039;, &#039;bar&#039;);
create table x ( col e1 );
alter table x alter column col type e2 using col::text::e2;

...and will correctly blow up if the data doesn&#039;t fit the second enum (ie, if you have any &#039;foo&#039; values there).

Maybe not the prettiest solution, but works.</description>
		<content:encoded><![CDATA[<p>@depesz: &#8220;until there will be sane way to add and remove elements from ENUM &#8211; functionality of this data type is very limited. So limited that I honestly can’t imagine myself any situation in which I would use it.&#8221;</p>
<p>You can create a new enum type and cast your columns to it (and recreate any functions using this type, which might get ugly).</p>
<p>create type e1 as enum (&#8216;a&#8217;, &#8216;b&#8217;, &#8216;foo&#8217;);<br />
create type e2 as enum (&#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;, &#8216;bar&#8217;);<br />
create table x ( col e1 );<br />
alter table x alter column col type e2 using col::text::e2;</p>
<p>&#8230;and will correctly blow up if the data doesn&#8217;t fit the second enum (ie, if you have any &#8216;foo&#8217; values there).</p>
<p>Maybe not the prettiest solution, but works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thormick</title>
		<link>http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/comment-page-1/#comment-26008</link>
		<dc:creator>Thormick</dc:creator>
		<pubDate>Mon, 05 May 2008 08:24:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/?p=1200#comment-26008</guid>
		<description>The second patch is very nice to have. Since 8.0 I&#039;ve been declaring such functions manually when I&#039;ve needed them, and it always seemed to be something that should have been included in Pg as standard.</description>
		<content:encoded><![CDATA[<p>The second patch is very nice to have. Since 8.0 I&#8217;ve been declaring such functions manually when I&#8217;ve needed them, and it always seemed to be something that should have been included in Pg as standard.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
