Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb6af64

Browse files
committed
Expose the "*VALUES*" alias that we generate for a stand-alone VALUES list.
We were trying to make that strictly an internal implementation detail,but it turns out that it's exposed anyway when dumping a view definedlikeCREATE VIEW test_view AS VALUES (1), (2), (3) ORDER BY 1;This comes out asCREATE VIEW ... ORDER BY "*VALUES*".column1;which fails to parse when reloading the dump.Hacking ruleutils.c to suppress the column qualification looks like it'dbe a risky business, so instead promote the RTE alias to full-fledgedusability.Per bug #6049 from Dylan Adams. Back-patch to all supported branches.
1 parentf0d72ef commiteb6af64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/parser/analyze.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ transformSelectStmt(ParseState *pstate, SelectStmt *stmt)
22312231
* transforms a VALUES clause that's being used as a standalone SELECT
22322232
*
22332233
* We build a Query containing a VALUES RTE, rather as if one had written
2234-
*SELECT * FROM (VALUES ...)
2234+
*SELECT * FROM (VALUES ...) AS "*VALUES*"
22352235
*/
22362236
staticQuery*
22372237
transformValuesClause(ParseState*pstate,SelectStmt*stmt)
@@ -2344,6 +2344,7 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt)
23442344
rtr->rtindex=list_length(pstate->p_rtable);
23452345
Assert(rte==rt_fetch(rtr->rtindex,pstate->p_rtable));
23462346
pstate->p_joinlist=lappend(pstate->p_joinlist,rtr);
2347+
pstate->p_relnamespace=lappend(pstate->p_relnamespace,rte);
23472348
pstate->p_varnamespace=lappend(pstate->p_varnamespace,rte);
23482349

23492350
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp