Hi
According to Postgresql documentation, the database object names are not case sensitive unless they are surrounded by quotes. If I execute the Sql : "Create database Test [...] ", a database test (in lowercase) is actually created, from ZeosLib like from any other tool. Fine.
But if I connect using Zeos (7.0.3) after having assigned the string "Test" (without quotes) to the database name of TZconnection, it raises : "database doesn't exists".
BuildConnectStr in ZDbcPostgreSql makes a connection string with double quotes surrounding the dbname, so it might be normal that the dbname is case sensitive.
However, I tried to change it without quotes surrounding the dbname, but I have the same error in ConnectDatabase which calls POSTGRESQL_API.PQconnectdb(ConnInfo), so I don't know what I can do ! It looks like the API is case sensitive. Is there a parameter to set ?
For now I will force to lowercase database names (maybe excepted those not surrounded by quotes), in my applications, but don't you think this should be done in Zeos ?
If someone has a better idea, he is welcome !
By the way, I do not remember that this problem existed in Zeos 6.6.6 (if someone has still it, can he say or test ?).
Thanks for any input.
database name case
Moderators: gto, cipto_kh, EgonHugeist, olehs
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
tintinux,
Can you check my UperCased suggestions please?
AFIAK you've created now an UpperCase DB: "TEST". I guess you should connect now with "TEST" not with "Test"."Create database Test [...] ", a database test (in lowercase) is actually created, from ..
I don't know many things about the 6.6-series but i know we had loads of bug-report accordingly case sensitive item-names. AFAIK do we make an identifier-quoting for all properties we have. So if you connect to "TEST" it will simply fail.By the way, I do not remember that this problem existed in Zeos 6.6.6 (if someone has still it, can he say or test ?).
Can you check my UperCased suggestions please?
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Hi
It looks like Postgresql convert to lowercase in a SQL instruction, but not at the API level.
I think we need a PostgresSql guru to be sure that there is nothing better to do than converting the database name to lowercase before connect.
Also, it would be interesting to know how it works with php or other languages.
Regards
Tintinux
No, when I use Test not surrounded with quotes the database test (lowercase) is created (according to pg documentation), but I can connect only with test (lowercase).I guess you should connect now with "TEST" not with "Test".
It looks like Postgresql convert to lowercase in a SQL instruction, but not at the API level.
I think we need a PostgresSql guru to be sure that there is nothing better to do than converting the database name to lowercase before connect.
Also, it would be interesting to know how it works with php or other languages.
Regards
Tintinux
-
- Junior Boarder
- Posts: 25
- Joined: 10.10.2009, 18:57
I agree that this is not a ZeosLib bug or issue.
But it is not normal that the same given database name (Test) works in a create query and not when assigned to a TZConnection.
We must change the case before opening, since Postgres API apparently don't. Every application can do this, but I just suggest that it could be done once by ZeosLib.
Regards,
Tintinux
But it is not normal that the same given database name (Test) works in a create query and not when assigned to a TZConnection.
We must change the case before opening, since Postgres API apparently don't. Every application can do this, but I just suggest that it could be done once by ZeosLib.
Regards,
Tintinux