Re: reloptions with a "namespace"

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: reloptions with a "namespace"
Date: 2009-01-14 14:43:32
Message-ID: 20090114144332.GF24156@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > This uses a new parse node.
>
> You need at least equalfuncs.c support for that, and outfuncs would be
> advisable.

Added.

> > One possible disadvantage is that a command
> > like this works, but does nothing:
> > alvherre=# alter table foo set (test.foo = 1);
>
> Uh, why doesn't it throw an error? We throw error for unrecognized
> reloptions in general.

I wasn't sure of the best place to add a check. I have added it to
transformRelOptions; I am not entirely comfortable with it, because it
works, but it still allows this:

alvherre=# alter index f set (toast.fillfactor = 20);
ALTER INDEX

The original case now fails correctly with

alvherre=# alter table foo set (test.foo = 1);
ERROR: 22023: unrecognized parameter namespace "test"
UBICACIÓN: transformRelOptions, /pgsql/source/04toastopt/src/backend/access/common/reloptions.c:490
alvherre=# alter table foo set (toast.foo = 1);
ERROR: 22023: unrecognized parameter "foo"
UBICACIÓN: parseRelOptions, /pgsql/source/04toastopt/src/backend/access/common/reloptions.c:694

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Emanuel Calvo Franco 2009-01-14 14:46:00 Re: inconsistency in aliasing
Previous Message Bruce Momjian 2009-01-14 14:35:42 Re: Documenting pglesslog