I'm using *SQLDialect.POSTGRES_9_4*
Jooq version is 3.6.2
I'm also using *settings.setRenderNameStyle(RenderNameStyle.AS_IS); * but I
dont think that should affect it.
On Tuesday, February 16, 2016 at 9:39:50 AM UTC-5, Lukas Eder wrote:
>
> Hi Max,
>
> That's interesting. What jOOQ version are you using? And what is the
> general context in which you are generating this SQL statement?
> I've tried:
>
> System.out.println(
> DSL.using(SQLDialect.POSTGRES)
> .renderContext()
> .render(DSL.decode().value(field("x",
> Boolean.class)).when(Boolean.FALSE, "true").otherwise("false"))
> );
>
>
> Which correctly yields:
>
>
> case x when ? then ? else ? end
>
>
> Do note that there are some subtle differences between PostgreSQL and
> Redshift (which is based on a modified PostgreSQL 8.0 version). We do
> provide commercial support for the Amazon Redshift database to take into
> account these subtle differences.
>
> Best Regards,
> Lukas
>
> 2016-02-14 1:42 GMT+01:00 Max Kremer <[email protected] <javascript:>>:
>
>> Hi,
>>
>> Trying to get a simple CASE expression in my SELECT statement
>>
>> I want the following:
>>
>>
>> select case some_bool
>> when true then 'true'
>> else 'false' end
>>
>>
>> My java looks like:
>>
>> DSL.decode().value(someBool).when(Boolean.FALSE, "true").otherwise(
>> "false");
>>
>> But the SQL it generates is
>>
>> select case when some_bool is not distinct from true then 'true'
>> when some_bool is not distinct from false then 'false'
>> end
>>
>> What's up with the "not distinct from" syntax?
>>
>> I'm using PostGreSQL but I'm also using Redshift. PostGreSQL is ok with
>> this but Redshift barfs :(
>>
>> Any suggestions?
>>
>> Thanks,
>> Max
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.