pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Andersen <david@andersen.gs>
Cc: pgsql-performance@postgresql.org
Subject: Re: Using ENUM with huge NAMEDATALEN
Date: Sat, 26 Jul 2008 20:36:00 -0400
Message-ID: <5850.1217118960@sss.pgh.pa.us> (raw)
In-Reply-To: <c6bf5b380807261713m2c413388y22814f22a8f6fd6a@mail.gmail.com>
References: <c6bf5b380807261422i77ed5b3evf55da6891e2e4170@mail.gmail.com>
	<4191.1217108664@sss.pgh.pa.us>
	<c6bf5b380807261448h65aac228i112cdca380bf4b4@mail.gmail.com>
	<c6bf5b380807261713m2c413388y22814f22a8f6fd6a@mail.gmail.com>

"David Andersen" <david@andersen.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



view thread (5+ messages)

Message-ID: <5850.1217118960@sss.pgh.pa.us>
Permalink:  ../5850.1217118960@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5850.1217118960@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david@andersen.gs
  Subject: Re: Using ENUM with huge NAMEDATALEN
  In-Reply-To: <5850.1217118960@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox