pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: peter.davie@convergentsolutions.com.au
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17176: Error raised on valid query
Date: Thu, 02 Sep 2021 14:52:55 -0400
Message-ID: <2264177.1630608775@sss.pgh.pa.us> (raw)
In-Reply-To: <17176-4a88906336898128@postgresql.org>
References: <17176-4a88906336898128@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> Hibernate is generating the following query:

> select distinct date_part('year', internalme0_.when_occurred) as col_0_0_,
> date_part('month', internalme0_.when_occurred) as col_1_0_, date_part('day',
> internalme0_.when_occurred) as col_2_0_, date_part('hour',
> internalme0_.when_occurred) as col_3_0_, date_part('minute',
> internalme0_.when_occurred) as col_4_0_ 
> from InternalMessages internalme0_ 
> group by date_part('year', internalme0_.when_occurred) , date_part('month',
> internalme0_.when_occurred) , date_part('day', internalme0_.when_occurred) ,
> date_part('hour', internalme0_.when_occurred) , date_part('minute',
> internalme0_.when_occurred) , internalme0_.when_occurred 
> order by date_part($1, internalme0_.when_occurred) asc, date_part($2,
> internalme0_.when_occurred) asc, date_part($3, internalme0_.when_occurred)
> asc, date_part($4, internalme0_.when_occurred) asc, date_part($5,
> internalme0_.when_occurred) asc

> The placeholders contain the values 'year', 'month', 'day', 'hour' and
> 'minute'.

Doesn't matter.  Those expressions are not semantically equivalent,
and your assertion of that doesn't make it so.  The query has to be
valid for any values of the placeholders.

(If you'd like to substitute specific parameter values in advance of
semantic analysis, then do it on the client side.)

			regards, tom lane





view thread (2+ messages)

Message-ID: <2264177.1630608775@sss.pgh.pa.us>
Permalink:  ../2264177.1630608775@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2264177.1630608775@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.davie@convergentsolutions.com.au, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17176: Error raised on valid query
  In-Reply-To: <2264177.1630608775@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox