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

Hi again,

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. Some output to make sure I do not
make any novice mistakes:

C:\Program Files\PostgreSQL\8.3\bin>psql -d postgres -U postgres
Welcome to psql 8.3.0, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

Warning: Console code page (850) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.

postgres=# GRANT ALL privileges ON TABLE pg_enum TO postgres;
GRANT
postgres=# alter table pg_enum ALTER COLUMN enumlabel TYPE text;
ERROR:  permission denied: "pg_enum" is a system catalog
STATEMENT:  alter table pg_enum ALTER COLUMN enumlabel TYPE text;
ERROR:  permission denied: "pg_enum" is a system catalog
postgres=# \du
                               List of roles
 Role name | Superuser | Create role | Create DB | Connections | Member of
-----------+-----------+-------------+-----------+-------------+-----------
 postgres  | yes       | yes         | yes       | no limit    | {}
 tull      | yes       | yes         | yes       | no limit    | {}
(2 rows)

postgres=#



Thanks in advance for your help.

Regards,

David


On Sat, Jul 26, 2008 at 11:48 PM, David Andersen <david@andersen.gs> wrote:

> Hi Tom,
>
> Thanks a lot for the tip! I will try this. You probably saved be a few days
> of work!
>
> Regards,
>
> David
>
>
> On Sat, Jul 26, 2008 at 11:44 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> "David Andersen" <david@andersen.gs> writes:
>> > One of the side tables is text with length of up to 900 characters. My
>> > question is whether I could build PostgreSQL with NAMEDATALEN  (which
>> > controls the max size of Enums) equal to 900?
>>
>> I wouldn't recommend it.  Consider changing pg_enum.enumlabel to type
>> TEXT instead.
>>
>>                        regards, tom lane
>>
>>
>>
>

view thread (5+ messages)  latest in thread

Message-ID: <c6bf5b380807261713m2c413388y22814f22a8f6fd6a@mail.gmail.com>
Permalink:  ../c6bf5b380807261713m2c413388y22814f22a8f6fd6a@mail.gmail.com/
Also on:    postgresql.org/message-id/c6bf5b380807261713m2c413388y22814f22a8f6fd6a@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: david@andersen.gs, tgl@sss.pgh.pa.us
  Subject: Re: Using ENUM with huge NAMEDATALEN
  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>

* 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