1 (edited by Ulph 2005-03-30 22:41)

Topic: Postgres is case sensitive

Yes, WHERE in postgres is case sensitive. This complicates the login procedure and this is why people could not login to my forum!

$result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE username=\''.$db->escape($form_username).'\'')

Fails.

Try using ILIKE.

Re: Postgres is case sensitive

It's supposed to be case sensitive. Why wouldn't it?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by Ulph 2005-03-31 14:02)

Re: Postgres is case sensitive

It makes people confused since they expect to be able to login as "rickard" even though they have registered as "Rickard".

If you think it should be case sensitive then maybe I should rename this bug report to "Mysql is not case sensitive" since I can login here as "uLPH".

Anyway. The point is that PunBB acts differently on postgres than on mysql.

Re: Postgres is case sensitive

Considering that it acts differently on MySQL and PostgreSQL, I will fix it. I'm not sure which way I will fix it though. Make the MySQL query case sensitive or make PostgreSQL case insensitive? The former makes more sense to me since the password is always case sensitive.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Postgres is case sensitive

well it should be case insensitive since 2 people can't register with the same username but different case?

6

Re: Postgres is case sensitive

I'd prefer if it was case insensitive since it has confused our users. I'm sure a lot of people who use PunBB on a mysql database and have a funny casing in their username would be unable to login if you changed it to be case sensitive. I changed the username matching to use ILIKE instead of the equal sign. Maybe that's a postgres specific operator though.

Re: Postgres is case sensitive

http://dev.punbb.org/changeset/154

I chose not to use ILIKE because then I would have to escape % and _ in the username.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8

Re: Postgres is case sensitive

Thanks.