Re: Bug in SQL/MED?

From: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: 花田 茂 <hanada(at)metrosystems(dot)co(dot)jp>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in SQL/MED?
Date: 2011-07-01 09:52:16
Message-ID: 4E0D98D0.8030408@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/6/30 Alvaro Herrera <alvherre(at)commandprompt(dot)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 Content-Type Size
fix_file_fdw_v2.patch text/plain 2.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikko Partio 2011-07-01 11:00:35 Re: PANIC while doing failover (streaming replication)
Previous Message Alexander Korotkov 2011-07-01 07:41:50 Re: WIP: Fast GiST index build