Re: reloptions with a "namespace" - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: reloptions with a "namespace"
Date
Msg-id 20090114144332.GF24156@alvh.no-ip.org
Whole thread Raw
In response to Re: reloptions with a "namespace"  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: reloptions with a "namespace"  (Euler Taveira de Oliveira <euler@timbira.com>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.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.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Documenting pglesslog
Next
From: Bruce Momjian
Date:
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)