Quirks in Sorting Pg_description

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

--
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux