Re: [HACKERS] fdw validation function vs zero catalog id

2009-12-23 Thread Heikki Linnakangas
Martin Pihlak wrote: I wrote: The validator is run for the generic options specified to CREATE/ALTER FDW, SERVER and USER MAPPING (+ possible future SQL/MED objects). In this case the catalog is always known. Also we can assume that the catalog is known, if a user runs the validator

Re: [HACKERS] fdw validation function vs zero catalog id

2009-12-22 Thread Martin Pihlak
I wrote: The validator is run for the generic options specified to CREATE/ALTER FDW, SERVER and USER MAPPING (+ possible future SQL/MED objects). In this case the catalog is always known. Also we can assume that the catalog is known, if a user runs the validator directly. So yes, AFAICS

Re: [HACKERS] fdw validation function vs zero catalog id

2009-12-21 Thread Martin Pihlak
Tom Lane wrote: The validator function must take two arguments: one of type text[], which will contain the array of options as stored in the system catalogs, and one of type oid, which will be the OID of the system catalog containing the options, or zero if the context is not known. Hmm,

[HACKERS] fdw validation function vs zero catalog id

2009-12-20 Thread Martin Pihlak
It appears that the function for validating generic options to a FDW, SERVER and USER MAPPING is always passed a catalog oid of 0. Whereas it should actually be passed the oid of the catalog that the options apply to. Attached patch fixes the issue by passing the proper catalog id from

Re: [HACKERS] fdw validation function vs zero catalog id

2009-12-20 Thread Tom Lane
Martin Pihlak martin.pih...@gmail.com writes: It appears that the function for validating generic options to a FDW, SERVER and USER MAPPING is always passed a catalog oid of 0. Whereas it should actually be passed the oid of the catalog that the options apply to. According to what? I can't

Re: [HACKERS] fdw validation function vs zero catalog id

2009-12-20 Thread Martin Pihlak
Tom Lane wrote: According to what? I can't find any documentation whatsoever on what arguments that function is supposed to get. regards, tom lane According to http://www.postgresql.org/docs/8.4/static/sql-createforeigndatawrapper.html: The validator function must

Re: [HACKERS] fdw validation function vs zero catalog id

2009-12-20 Thread Tom Lane
Martin Pihlak martin.pih...@gmail.com writes: Tom Lane wrote: According to what? I can't find any documentation whatsoever on what arguments that function is supposed to get. According to http://www.postgresql.org/docs/8.4/static/sql-createforeigndatawrapper.html: The validator function