Re: Using ENUM with huge NAMEDATALEN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David Andersen" <david(at)andersen(dot)gs>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Using ENUM with huge NAMEDATALEN
Date: 2008-07-27 00:36:00
Message-ID: 5850.1217118960@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"David Andersen" <david(at)andersen(dot)gs> writes:
> I am attempting to alter pg_enum.enumlabel to Text, but I seem to run into a
> strange permission problem with regards to system tables. I am not allowed
> to modify them even if I am a superuser.

ALTER TABLE is hardly gonna be sufficient on a system catalog anyway, as
knowledge of its rowtype is generally hardwired into the C code. You'd
have to modify src/include/catalog/pg_enum.h and then go around and find
all the references to enumlabel and fix them to know it's text not name.
Fortunately, this being not a widely used catalog, there shouldn't be
too many places to fix. Right offhand, it looks like the indexing.h
definition of its index and about three places in pg_enum.c would be all
that have to change.

Note that this would be an initdb-forcing change and so you should also
bump the catversion number.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Faludi Gábor 2008-07-28 06:43:51 how does pg handle concurrent queries and same queries
Previous Message David Andersen 2008-07-27 00:13:47 Re: Using ENUM with huge NAMEDATALEN