I wrote:
> Another possibility that just occurred to me is to call the validator
> like this:
>
> if (OidIsValid(fdwvalidator))
> {
> Datumvalarg = result;
>
> /* pass a null options list as an empty array */
> if (DatumGetPointer(valarg) == NULL)
>
Shigeru Hanada writes:
> Thanks for the comments. Please find attached a patch. Now file_fdw
> validates filename in:
> * file_fdw_validator(), to catch lack of required option at DDL
> * fileGetOptions(), to avoid crash caused by corrupted catalog
Applied with small adjustments.
I wrote:
> I think it might be better to keep the convention that an empty options
> list is represented by null, and to say that if a validator wants to be
> called on such a list, it had better declare itself non-strict. At
> least we ought to think about that before redefining the catalog
> sem
Robert Haas writes:
> 2011/7/1 Shigeru Hanada :
>> I used ereport for the former check, because maybe such error usually
>> happens and is visible to users. Â This criteria was taken from the
>> document "Reporting Errors Within the Server".
>> http://developer.postgresql.org/pgdocs/postgres/error
Robert Haas wrote:
I attached a patch which fixes file_fdw to check required option
(filename) in its validator function. I think that such requirement
should be checked again in PlanForeignScan(), as it had been so far.
Note that this patch requires fdw.patch has been applied.
2011/7/1 Shigeru Hanada :
> 2011/6/30 Alvaro Herrera :
>> Excerpts from 花田 茂's message of jue jun 30 06:00:23 -0400 2011:
>>
>>> I attached a patch which fixes file_fdw to check required option
>>> (filename) in its validator function. I think that such requirement
>>> should be checked again in P
2011/6/30 Alvaro Herrera :
> Excerpts from 花田 茂's message of jue jun 30 06:00:23 -0400 2011:
>
>> I attached a patch which fixes file_fdw to check required option
>> (filename) in its validator function. I think that such requirement
>> should be checked again in PlanForeignScan(), as it had been
Excerpts from 花田 茂's message of jue jun 30 06:00:23 -0400 2011:
> I attached a patch which fixes file_fdw to check required option
> (filename) in its validator function. I think that such requirement
> should be checked again in PlanForeignScan(), as it had been so far.
> Note that this patch re
(2011/06/29 21:23), Albe Laurenz wrote:
> If you invoke any of the SQL/MED CREATE or ALTER commands,
> the validator function is only called if an option list was given.
>
> That means that you cannot enforce required options at object creation
> time, because the validator function is not always
I wrote:
> If you invoke any of the SQL/MED CREATE or ALTER commands,
> the validator function is only called if an option list was given.
[...]
> Example:
[...]
The example is misleading. Here a better one:
CREATE SERVER myoradb FOREIGN DATA WRAPPER oracle_fdw OPTIONS (foo
'bar');
ERROR: inva
If you invoke any of the SQL/MED CREATE or ALTER commands,
the validator function is only called if an option list was given.
That means that you cannot enforce required options at object creation
time, because the validator function is not always called.
I consider that unexpected an undesirable
11 matches
Mail list logo