Error attribution in foreign scans

From: Noah Misch <noah(at)leadboat(dot)com>
To: hanada(at)metrosystems(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Subject: Error attribution in foreign scans
Date: 2011-02-07 12:17:34
Message-ID: 20110207121734.GB22669@tornado.gateway.2wire.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Suppose you create several file_fdw foreign tables, query them together, and
read(2) returns EIO for one of the files:

[local] postgres=# SELECT * FROM ft0, ft1, ft2;
ERROR: could not read from COPY file: Input/output error

The message does not show which foreign table yielded the error. We could evade
the problem in this case by adding a file name to the error message in the COPY
code, but that strategy doesn't translate to twitter_fdw, firebird_fdw, etc. We
need a convention for presenting foreign errors that clearly attributes them to
the originating foreign table. What should it be?

Perhaps something as simple as having the core foreign scan code push an error
context callback that does errcontext("scan of foreign table \"%s\"", tabname)?

Disclaimer: I have only skimmed SQL/MED patches other than copy_export.

Thanks,
nm

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2011-02-07 12:33:23 Re: Range Types
Previous Message Noah Misch 2011-02-07 12:16:37 Re: SQL/MED - file_fdw