Quirks in Sorting Pg_description

From: P <user2037(at)live(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Quirks in Sorting Pg_description
Date: 2010-03-03 14:15:50
Message-ID: BLU0-SMTP6181655A9EC3DB104B4AFFB43A0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

The following query works from Psql's prompt but not from Psql's "-c"
command or from PHP's PDO interface.

SELECT description FROM pg_catalog.pg_description WHERE description
SIMILAR TO '\d+' ORDER BY description::integer DESC LIMIT 1;

The result should be the description with the highest integer value.
Instead it appears to be sorting like text even though it has been cast
to an integer.

Anyone know of a workaround?

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Major Services 2010-03-03 14:37:23 Re: password authentication failed for user postgres
Previous Message Major Services 2010-03-03 12:32:15 Re: Restart failed with 'service postgresql restart'