Re: Dumped SQL failed to execute with ERROR "GROUP BY position -1 is not in select list"

Поиск
Список
Период
Сортировка
От Haotian Chen
Тема Re: Dumped SQL failed to execute with ERROR "GROUP BY position -1 is not in select list"
Дата
Msg-id KL1PR03MB7286986C2C69A87DF4E12074A486A@KL1PR03MB7286.apcprd03.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Dumped SQL failed to execute with ERROR "GROUP BY position -1 is not in select list"  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers

> The thing to do here is modify pg_operator.dat and give both of these
> operators an "oid_symbol". Perhaps Int4NegOperator is ok. 

Thanks for suggestions, I replaced hacking oids with Int4NegOperator and NumericNegOperator.

And I also updated some comments and commit message.

 

Please feel free to review latest version patch v3-0001-Printing-const-folder-expression-in-ruleutils.c.patch

 

Best regards,

Haotian

 

 

From: David Rowley <dgrowleyml@gmail.com>
Date: Monday, December 4, 2023 at 06:08
To: Haotian Chen <charliett2233@outlook.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Dumped SQL failed to execute with ERROR "GROUP BY position -1 is not in select list"

On Mon, 4 Dec 2023 at 02:38, Haotian Chen <charliett2233@outlook.com> wrote:
> Yes, I updated my patch and just used oid numbers 558 and 1751 stand for
> int4um and numeric_uminus. Maybe we could define a macro for them,
> but seems unnecessary.

The thing to do here is modify pg_operator.dat and give both of these
operators an "oid_symbol". Perhaps Int4NegOperator is ok.  (I think
Int4UnaryMinusOperator might be on the verbose side.).  The code that
parses pg_operator.dat will then define that constant in
pg_operator_d.h.  You can then use that and the other ones you defined
for the numeric operator instead of hard coding the Oids in the patch.

David

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Should REINDEX be listed under DDL?
Следующее
От: Michael Paquier
Дата:
Сообщение: Failure with pgbench and --disable-thread-safety in ~v16