Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A8C29650350 for ; Sat, 26 Jul 2008 21:15:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 32679-01 for ; Sat, 26 Jul 2008 21:14:27 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by postgresql.org (Postfix) with ESMTP id 8F6FD64FD37 for ; Sat, 26 Jul 2008 21:13:48 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so4766461rvf.43 for ; Sat, 26 Jul 2008 17:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=f8//uFFX1fDXKU+PMzb3y0nwnjEHZHMQ7N/iZi+A3zM=; b=Ys9R56V/1kKQfcllo05FVVAyEpk5JbfW5K9X5E4liNvYHYwAPL+Z8KzVtRpTHWfsJq 12odQ6eUHDeaY6BaKMVjPwANFaqqgGVVP9KgM7+Qrw17Gk8b/CRn4Nijn+7pe8GON3Ov EMa3b7SBKCH9aOPUdWRQ7GgLGISjZDy5Ab93w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=hnWd830wpq9tjqBIftcqdZwU7W9y69L4hRMjFPU1UnrDSfaby9bY4UhicHB0V9RqTn qS0D+nV6Bgba3xh01sgNOC2CC56MdzQZoXAA1FOAyJqCDu2mCMYbHXbK1qztrZWz5uhe 6Bdd3W+JbVOlx+STaTl3uVGdTmL+IJxMuaaIY= Received: by 10.141.44.13 with SMTP id w13mr1624047rvj.181.1217117627337; Sat, 26 Jul 2008 17:13:47 -0700 (PDT) Received: by 10.140.177.2 with HTTP; Sat, 26 Jul 2008 17:13:47 -0700 (PDT) Message-ID: Date: Sun, 27 Jul 2008 02:13:47 +0200 From: "David Andersen" To: "Tom Lane" Subject: Re: Using ENUM with huge NAMEDATALEN Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3040_23672412.1217117627329" References: <4191.1217108664@sss.pgh.pa.us> X-Google-Sender-Auth: c4f9b2cfa3221de4 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/230 X-Sequence-Number: 30830 ------=_Part_3040_23672412.1217117627329 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 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 wrote: > >> "David Andersen" 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 >> >> >> > ------=_Part_3040_23672412.1217117627329 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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




------=_Part_3040_23672412.1217117627329--