Re: Bug in SQL/MED? - Mailing list pgsql-hackers

From Shigeru Hanada
Subject Re: Bug in SQL/MED?
Date
Msg-id 4E0D98D0.8030408@gmail.com
Whole thread Raw
In response to Re: Bug in SQL/MED?  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Bug in SQL/MED?
Re: Bug in SQL/MED?
List pgsql-hackers
2011/6/30 Alvaro Herrera <alvherre@commandprompt.com>:
> 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 requires fdw.patch has been applied.
>
> I think it'd be good to keep the error check in fileGetOptions() just to
> ensure that we don't crash in case a catalog is messed up with, though
> I'd degrade it to elog(ERROR) from ereport.

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

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-message-reporting.html

Regards,
--
Shigeru Hanada


Attachment

pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: WIP: Fast GiST index build
Next
From: Mikko Partio
Date:
Subject: Re: [ADMIN] PANIC while doing failover (streaming replication)