mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Get rid of postgres_fdw's assumption that remote type OIDs match ours.
The only place we depended on that was in sending numeric type OIDs in PQexecParams; but we can replace that usage with explicitly casting each Param symbol in the query string, so that the types are specified to the remote by name not OID. This makes no immediate difference but will be essential if we ever hope to support use of non-builtin types.
This commit is contained in:
@ -558,11 +558,11 @@ EXPLAIN (VERBOSE, COSTS false) EXECUTE st4(1);
|
||||
|
||||
-- once we try it enough times, should switch to generic plan
|
||||
EXPLAIN (VERBOSE, COSTS false) EXECUTE st4(1);
|
||||
QUERY PLAN
|
||||
----------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
Foreign Scan on public.ft1 t1
|
||||
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
||||
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1))
|
||||
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $1::integer))
|
||||
(3 rows)
|
||||
|
||||
-- value of $1 should not be sent to remote
|
||||
@ -613,12 +613,12 @@ EXPLAIN (VERBOSE, COSTS false) EXECUTE st5('foo', 1);
|
||||
(4 rows)
|
||||
|
||||
EXPLAIN (VERBOSE, COSTS false) EXECUTE st5('foo', 1);
|
||||
QUERY PLAN
|
||||
----------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
Foreign Scan on public.ft1 t1
|
||||
Output: c1, c2, c3, c4, c5, c6, c7, c8
|
||||
Filter: (t1.c8 = $1)
|
||||
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $2))
|
||||
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = $2::integer))
|
||||
(4 rows)
|
||||
|
||||
EXECUTE st5('foo', 1);
|
||||
|
Reference in New Issue
Block a user