JZ
Yes, using capital letters in table or view, or column or whatever
identifiers is sinful and wrong.
You are saying that the SQL standard is sinful and wrong.
That's not PostgreSQL's position.
To the original question:
PostgreSQL folds all names to lower case unless you surround them
with double quotes. I don't know how this can be done in Hibernate,
but it would be the solution.
Yours,
Laurenz Albe
>> Yes, using capital letters in table or view, or column or whatever identifiers is sinful and wrong.
>
> You are saying that the SQL standard is sinful and wrong.
Would that be blasphemous? :-)
Actually, I was meaning that using upper/mixed case as identifiers is
bad practice.
> Marco Mariani wrote:
>> Jaroslav Záruba wrote:
>>> When I use capital letter(s) in table or view name Hibernate complains
>>> it can't find the relation. :(
>>> Is this known issue or am I doing something wrong?
>>
>> Yes, using capital letters in table or view, or column or whatever
>> identifiers is sinful and wrong.
>
> You are saying that the SQL standard is sinful and wrong. That's not
> PostgreSQL's position.
But it can condemn your immortal soul to MySQL for all eternity.
Yes, I'm aware of that PostgresSQL's behaviour.
I hoped someone with Hibernate experience would shed some light on
this. Like whether this is known bug, and who is the one blame -
Hibernate or the PostgreSQL driver? :)
>
> Yours,
> Laurenz Albe
Cheers
Jarda
In my opinion "sinful and wrong" is case-insensitivity. :)
> Yes, I'm aware of that PostgresSQL's behaviour. I hoped someone with
> Hibernate experience would shed some light on this.
> Like whether this is known bug,
Nope, it's an expected behavior. PostgreSQL can use tables with capital
letters, only enclosed in double quotes.
> and who is the one blame - Hibernate or the PostgreSQLdriver? :)
Why, Hibernate of course! This is a PostgreSQL forum, after all. There is
no blame in this case, though. You'll just have to rewrite your queries.
I don't think it is expected behaviour to get an error message when
you write the relation name properly. One would expect things to work
- i.e. to to enclose relation name within quotes if needed for a
particular db-system.
When speaking about bug I mean bug somewhere in the communication
between Hibernate and PostgreSQL - which also involves the driver. So
either Hibernate or the driver can be blamed for omitting the
enclosing chars.
Purpose of my post was to ask users experienced with Hibernate
+PostgreSQL whether this is known bug (yes, bug) or whether there is
some ?hidden? switch/option that would force Hibernate or the driver
to use the enclosing chars.
> > and who is the one blame - Hibernate or the PostgreSQLdriver? :)
>
> Why, Hibernate of course! This is a PostgreSQL forum, after all. There is
> no blame in this case, though. You'll just have to rewrite your queries.
How can I rewrite my queries when I do not write any at all?