Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Some generated queries fail in PostgreSQL with pgjdbc-ng driver

Sorry, I can't answer that question.

Perhaps you want to file an issue for this.

What helps with filing issues, is to create a maven test case. I
usually make a copy for other providers e.g. Hibernate and OpenJPA to
verify that they function as expected.

BTW you are posting iin HTML format which is not accepted in mailing
lists.

Regards,

Bernard


On Tue, 27 Aug 2013 12:34:49 +0200 (CEST), you wrote:

><div>På tirsdag 27. august 2013 kl. 10:54:04, skrev Bernard &lt;<a href="mailto:bht237@xxxxxxxxx"; target="_blank">bht237@xxxxxxxxx</a>&gt;:</div>
>
><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
><div style="display:inline; font-family: monospace; font-size: 12px;">That's Postgresql, the only database engine I know of that does this.<br>
>Asking EL to fix this is probably not a bad idea, because the<br>
>Postgresql people behave like gods. The problem is normally in the<br>
>engine not the driver.<br>
><br>
>They have an excuse for why they expect that even null has a type<br>
>parameter so you cannot write some standard JPQL queries.<br>
><br>
>See https://github.com/pgjdbc/pgjdbc/issues/3 for another example.<br>
><br>
>I would try to use the EL &quot;cast&quot; extension as a workaround. This<br>
>solved all my problems.<br>
><br>
>Otherwise if I was you I wouldn't hesitate to make a lot of noise in<br>
>the Postgresql mailing lists - they are so unprofessional they do not<br>
>even have a bug tracking system. Really, I am not joking. You can't<br>
>find out the status of anything that you report there.</div>
></blockquote>
>
><div> </div>
>
><div>Ok. Even if PG cannot support preparing statements for unknown types, this specific issue seems to be easily solved by having EL generate &quot;...WHERE EXISTS (SELECT <span style="background-color:#FFFF00;">1</span> FROM ...)&quot; instead of &quot;SELECT ? FROM&quot; and setting 1 as value, maby even generate &quot;SELECT * FROM&quot; as the sub-query and have the enginge optimize it the way it wants (I seem to remember someone on the PG-list informing that best practice is to issue EXISTS(SELECT * FROM ..) instead of (SELECT 1 ...)).</div>
>
><div> </div>
>
><div>How do I use the EL cast-extention? I tried with &quot; WHERE EXISTS(SELECT cast(e.id INTEGER) FROM MyEntity e)&quot; but it still generated the &quot;SELECT ? FROM&quot;-query.</div>
>
><div> </div>
>
><div class="origo-email-signature">--<br>
>Andreas Joseph Krogh &lt;andreak@xxxxxxxxxxxx&gt;      mob: +47 909 56 963<br>
>Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no<br>
>Public key: http://home.officenet.no/~andreak/public_key.asc</div>
>
><div> </div>



Back to the top