From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: 'Kohei KaiGai' <kaigai@kaigai.gr.jp>
To: 'Shigeru HANADA' <shigeru.hanada@gmail.com>
Cc: 'PostgreSQL-development' <pgsql-hackers@postgresql.org>
Subject: Re: pgsql_fdw in contrib
Date: Thu, 12 Jul 2012 19:10:40 +0900
Message-ID: <002301cd6016$971671f0$c54355d0$@lab.ntt.co.jp> (raw)
In-Reply-To: <CADyhKSViO=i5tMQWS=bvAdkY6ugZs9p7Cd-sdCrc3jRPeZjD8g@mail.gmail.com>
References: <4FD9D947.1020803@gmail.com>
<CADyhKSXs3d-2mvM=5c_GpehQd_nULL-GbGggLVeVKNn5R6odjA@mail.gmail.com>
<CADyhKSViO=i5tMQWS=bvAdkY6ugZs9p7Cd-sdCrc3jRPeZjD8g@mail.gmail.com>
> 2012/6/26 Kohei KaiGai <kaigai@kaigai.gr.jp>:
> > Harada-san,
> >
> > I checked your patch, and had an impression that includes many
> > improvements from the previous revision that I looked at the last
> > commit fest.
> >
> > However, I noticed several points to be revised, or investigated.
> >
> > * It seems to me expected results of the regression test is not
> > attached, even though test cases were included. Please add it.
KaiGai-san, Did you find the file? That is in the contrib/pgsql_fdw/expected
directory, named pgsql_fdw.out. If necessary, I will send the file to you.
BTW, I found some bugs on the expected results of the file. Attached is a patch
fixing the bugs.
Thanks,
Best regards,
Etsuro Fujita
Attachments:pgsql_fdw_regress.patch (application/octet-stream, 3.5K) download
*** pgsql_fdw.out.orig 2012-07-12 18:01:49.000000000 +0900
--- pgsql_fdw.out 2012-07-12 18:11:15.000000000 +0900
***************
*** 445,464 ****
-- subquery using stable function (can't be pushed down)
PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND EXTRACT(dow FROM c4) = 6) ORDER BY c1;
EXPLAIN (COSTS false) EXECUTE st2(10, 20);
! QUERY PLAN
! -----------------------------------------------------------------------------------------------------------------------------------------------
Sort
Sort Key: t1.c1
! -> Hash Join
! Hash Cond: (t1.c3 = t2.c3)
-> Foreign Scan on ft1 t1
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7 FROM "S 1"."T 1" WHERE (("C 1" OPERATOR(pg_catalog.<) 20))
! -> Hash
! -> HashAggregate
! -> Foreign Scan on ft2 t2
! Filter: (date_part('dow'::text, c4) = 6::double precision)
! Remote SQL: SELECT "C 1", NULL, c3, c4, NULL, NULL, NULL FROM "S 1"."T 1" WHERE (("C 1" OPERATOR(pg_catalog.>) 10))
! (11 rows)
EXECUTE st2(10, 20);
c1 | c2 | c3 | c4 | c5 | c6 | c7
--- 445,463 ----
-- subquery using stable function (can't be pushed down)
PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND EXTRACT(dow FROM c4) = 6) ORDER BY c1;
EXPLAIN (COSTS false) EXECUTE st2(10, 20);
! QUERY PLAN
! -----------------------------------------------------------------------------------------------------------------------------------------
Sort
Sort Key: t1.c1
! -> Nested Loop Semi Join
! Join Filter: (t1.c3 = t2.c3)
-> Foreign Scan on ft1 t1
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7 FROM "S 1"."T 1" WHERE (("C 1" OPERATOR(pg_catalog.<) 20))
! -> Materialize
! -> Foreign Scan on ft2 t2
! Filter: (date_part('dow'::text, c4) = 6::double precision)
! Remote SQL: SELECT "C 1", NULL, c3, c4, NULL, NULL, NULL FROM "S 1"."T 1" WHERE (("C 1" OPERATOR(pg_catalog.>) 10))
! (10 rows)
EXECUTE st2(10, 20);
c1 | c2 | c3 | c4 | c5 | c6 | c7
***************
*** 574,580 ****
-- ===================================================================
ALTER FOREIGN TABLE ft1 ALTER COLUMN c5 TYPE int;
SELECT * FROM ft1 WHERE c1 = 1; -- ERROR
! ERROR: invalid input syntax for integer: "1970-01-02 00:00:00"
CONTEXT: column c5 of foreign table ft1
ALTER FOREIGN TABLE ft1 ALTER COLUMN c5 TYPE timestamp;
-- ===================================================================
--- 573,579 ----
-- ===================================================================
ALTER FOREIGN TABLE ft1 ALTER COLUMN c5 TYPE int;
SELECT * FROM ft1 WHERE c1 = 1; -- ERROR
! ERROR: invalid input syntax for integer: "Fri Jan 02 00:00:00 1970"
CONTEXT: column c5 of foreign table ft1
ALTER FOREIGN TABLE ft1 ALTER COLUMN c5 TYPE timestamp;
-- ===================================================================
=
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: fujita.etsuro@lab.ntt.co.jp, kaigai@kaigai.gr.jp, shigeru.hanada@gmail.com
Subject: Re: pgsql_fdw in contrib
In-Reply-To: <002301cd6016$971671f0$c54355d0$@lab.ntt.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox