-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Match heap tables with fully qualified name
* Matching tables entry in replacement scan should work with a fully qualified name. * Alias for `TableRef` is set explicitly
- Loading branch information
Showing
4 changed files
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE t(a INT); | ||
INSERT INTO t SELECT g from generate_series(1,10) g; | ||
SELECT count(*) FROM t; | ||
SELECT count(*) FROM public.t; | ||
|
||
-- Create schema `other` | ||
CREATE SCHEMA other; | ||
CREATE TABLE other.t(a INT); | ||
INSERT INTO other.t SELECT g from generate_series(1,100) g; | ||
SELECT count(*) FROM other.t; | ||
|
||
-- Test fully qualified table name combinations | ||
SELECT count(*) FROM public.t, other.t; | ||
SELECT count(*) FROM t, other.t; | ||
SELECT count(*) FROM t,t; | ||
|
||
-- search_path ORDER matters. | ||
SET search_path TO other, public; | ||
SELECT count(*) FROM t; | ||
SELECT count(*) FROM t, public.t; | ||
|
||
-- No search_path | ||
SET search_path TO ''; | ||
SELECT count(*) FROM t, other.t; | ||
SELECT count(*) FROM public.t, other.t; | ||
|
||
-- Cleanup | ||
DROP TABLE other.t; | ||
DROP SCHEMA other; | ||
RESET search_path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters