Re: BUG #18589: pg_get_viewdef returns wrong query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: tlhquynh(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18589: pg_get_viewdef returns wrong query
Date: 2024-08-27 13:23:08
Message-ID: 3038762.1724764988@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> Alternatively, can we set special_exprkind = EXPR_KIND_ORDER_BY in
> get_rule_orderby? I’m looking for a approach that is parallel to how
> we set special_exprkind = EXPR_KIND_GROUP_BY in get_basic_select_query.

I don't want to do that because it would result in prefixing Vars
within grouping/ordering expressions, which is unnecessary. Only
a bare Var requires this treatment.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-08-27 14:42:33 Re: BUG #18589: pg_get_viewdef returns wrong query
Previous Message David G. Johnston 2024-08-27 12:30:15 Re: Bug in PostgreSQL 15 : Facing error in PG15