Alvaro Herrera escreveu: > Euler Taveira de Oliveira wrote: >> Alvaro Herrera escreveu: >>> 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: >>> >> IMHO it's the appropriate place. > > I think the best place would be parseRelOptions. The problem is that > transformRelOptions does not apply any semantics to the values it's > parsing; it doesn't know about the relopt_kind for example. That stuff > is only known by parseRelOptions, but when the options reach that point, > they have already lost the namespace (due to transformRelOptions). > [Looking at your patch...] You're right. The only command that doesn't use parseRelOptions() is ALTER INDEX. Is it the case to add a call at index_reloptions() too? If it is not the case, I think you need to pass 'nmspc.relopt=value' instead of 'relopt=value' at transformRelOptions(). Of course, you'll need to add some code at index_reloptions() to validate reloptions.
The following message doesn't say much. Isn't it the case to replace 'opt_definition' with 'OptWith' variant at gram.y? euler=# create index fooi on foo(a) with (nmspc.relopt = 32); ERROR: syntax error at or near "." LINHA 1: create index fooi on foo(a) with (nmspc.relopt = 32); ^ -- Euler Taveira de Oliveira http://www.timbira.com/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers