Skip to content

Checking for table relation respects temporary tables#2349

Merged
NathanGabrielson merged 4 commits intomainfrom
nathan/tempTblRelation
Feb 19, 2026
Merged

Checking for table relation respects temporary tables#2349
NathanGabrielson merged 4 commits intomainfrom
nathan/tempTblRelation

Conversation

@NathanGabrielson
Copy link
Contributor

Fixes #2326

When checking for whether a root has a relation, we should respect temporary tables in addition to our existing checks for regular tables.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

Main PR
covering_index_scan_postgres 545.98/s 536.51/s -1.8%
index_join_postgres 119.19/s 115.75/s -2.9%
index_join_scan_postgres 174.24/s 173.16/s -0.7%
index_scan_postgres 11.04/s 10.84/s -1.9%
oltp_point_select 2232.55/s 2215.91/s -0.8%
oltp_read_only 1650.49/s 1656.71/s +0.3%
select_random_points 104.18/s 106.47/s +2.1%
select_random_ranges 419.66/s 415.16/s -1.1%
table_scan_postgres 10.83/s 10.72/s -1.1%
types_table_scan_postgres 4.96/s 4.91/s -1.1%

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

Main PR
Total 42090 42090
Successful 17571 17588
Failures 24519 24502
Partial Successes1 5585 5585
Main PR
Successful 41.7463% 41.7866%
Failures 58.2537% 58.2134%

${\color{lightgreen}Progressions (17)}$

copy2

QUERY: CREATE TEMP TABLE x (
	a serial,
	b int,
	c text not null default 'stuff',
	d text,
	e text
) ;
QUERY: CREATE TRIGGER trg_x_after AFTER INSERT ON x
FOR EACH ROW EXECUTE PROCEDURE fn_x_after();
QUERY: CREATE TRIGGER trg_x_before BEFORE INSERT ON x
FOR EACH ROW EXECUTE PROCEDURE fn_x_before();

functional_deps

QUERY: CREATE TEMP TABLE node (
    nid SERIAL,
    vid integer NOT NULL default '0',
    type varchar(32) NOT NULL default '',
    title varchar(128) NOT NULL default '',
    uid integer NOT NULL default '0',
    status integer NOT NULL default '1',
    created integer NOT NULL default '0',
    -- snip
    PRIMARY KEY (nid, vid)
);

plpgsql

QUERY: create temp table users(login text, id serial);

rangefuncs

QUERY: create temp table tt(f1 serial, data text);
QUERY: create trigger tnoticetrigger after insert on tt for each row
execute procedure noticetrigger();

returning

QUERY: CREATE TEMP TABLE foo (f1 serial, f2 text, f3 int default 42);

sequence

QUERY: CREATE TEMP TABLE t1 (
  f1 serial,
  f2 int DEFAULT nextval('myseq2'),
  f3 int DEFAULT nextval('myseq3'::text)
);

triggers

QUERY: create trigger parent_upd_trig before update on parent
  for each row execute procedure parent_upd_func();
QUERY: create trigger parent_del_trig before delete on parent
  for each row execute procedure parent_del_func();
QUERY: create trigger child_ins_trig after insert on child
  for each row execute procedure child_ins_func();
QUERY: create trigger child_del_trig after delete on child
  for each row execute procedure child_del_func();

tuplesort

QUERY: CREATE TEMP TABLE abbrev_abort_uuids (
    id serial not null,
    abort_increasing uuid,
    abort_decreasing uuid,
    noabort_increasing uuid,
    noabort_decreasing uuid);
QUERY: INSERT INTO abbrev_abort_uuids DEFAULT VALUES;
QUERY: INSERT INTO abbrev_abort_uuids DEFAULT VALUES;

with

QUERY: CREATE TRIGGER y_trig BEFORE INSERT ON y FOR EACH ROW
    EXECUTE PROCEDURE y_trigger();

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, just a minor suggestion on moving it up one function higher in the call chain. I'm happy to take another look after that change if you want.

@NathanGabrielson NathanGabrielson merged commit 8c297bc into main Feb 19, 2026
17 checks passed
@NathanGabrielson NathanGabrielson deleted the nathan/tempTblRelation branch February 19, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot create keyless temporary tables with serial columns

2 participants

Comments