Re: CREATE FOREGIN TABLE LACUNA
Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Fetter <david@fetter.org>, Robert Haas <robertmhaas@gmail.com>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2012-03-15T09:50:44Z
Lists: pgsql-hackers
(2012/03/15 0:29), Tom Lane wrote: > The posted patch for file_fdw takes the > approach of silently filtering out rows for which they're not true, > which is not obviously the right thing either --- quite aside from > whether that's a sane semantics, it's not going to scale to foreign key > constraints, and even for simple NOT NULL and CHECK constraints it > results in a runtime penalty on selects, which is not what people would > expect from a constraint. I investigated DB2 a little bit. In DB2, the user can specify the VALIDATE_DATA_FILE option as a generic option for an external table attached to a data file, which specifies if the wrapper verifies that the data file is sorted. How about introducing this kind of option to file_fdw? It might be better that the default value for the option is 'false', and if the value is set to 'true', then file_fdw verifies NOT NULL, CHECK, and foreign key constraints. Best regards, Etsuro Fujita