Re: pgsql_fdw, FDW for PostgreSQL server

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Shigeru HANADA *EXTERN*" <shigeru(dot)hanada(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>, "Kohei KaiGai" <kaigai(at)kaigai(dot)gr(dot)jp>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>
Subject: Re: pgsql_fdw, FDW for PostgreSQL server
Date: 2012-04-03 13:31:46
Message-ID: D960CB61B694CF459DCFB4B0128514C207B2C8B2@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shigeru HANADA wrote:
> Attached are latest version of pgsql_fdw patches. Note that
> pgsql_fdw_analyze.patch is only for test the effect of local
statistics.
> Please apply patches in the order below:
>
> (1) pgsql_fdw_v18.patch
> (2) pgsql_fdw_pushdown_v11.patch
> (3) pgsql_fdw_analyze.patch (if you want to try local stats)

Since Kohei KaiGai doesn't post a review, I'll have a go.

The patch applies and compiles fine without warnings and passes
regression tests.

I found bugs in the analyze functions:

In pgsql_fdw_analyze:
nspname and relname are not initialized to NULL.
This causes failure if the corresponding option is not set
on the foreign table.

In store_remote_stats:
atttypmod is initialized to 0 and never changed.
This causes the following error for columns of type "interval":
ERROR: unrecognized interval typmod: 0

During a foreign scan, type input functions are used to convert
the text representation of values. If a foreign table is misconfigured,
you can get error messages from these functions, like:

ERROR: invalid input syntax for type double precision: "etwas"
or
ERROR: value too long for type character varying(3)

It might me nice for finding problems if the message were
something like:

ERROR: cannot convert data in foreign scan of "tablename", column "col"
in row 42
DETAIL: ERROR: value too long for type character varying(3)

As stated previously, I don't think that using local stats on
foreign tables is a win. The other patches work fine for me, and
I'd be happy if that could go into 9.2.

Once the two bugs above are fixed, should I mark it "ready for
committer"?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-04-03 13:34:41 Re: patch for parallel pg_dump
Previous Message Andrew Dunstan 2012-04-03 13:26:52 parallel pg_dump