database name case
Posted: 08.01.2013, 14:00
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.
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.