Search Postgresql Archives

Re: select statement sorting

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

 



On Wed, Mar 31, 2004 at 10:31:43AM -0500, Alexander Cohen wrote:
> is it possible to have postgres return a "SELECT * FROM table ORDER BY 
> table_column" query that is not case sensitive order?

> Is this possible or do i need to sort them myself after the query 
> returns?

SELECT * FROM table ORDER BY lower(table_column)

will do what you want.

[ If you start using this idiom for larger tables then remember that order
  by lower(something) won't take any advantage of an index on something -
  but may use a functional index on lower(something) ]
 
> Also, i noticed that postgres will let me create groups, databases and 
> users with spaces in their names, is this ok or should i check this 
> beforehand and not allow this?

I'd avoid it. It may well be acceptable within postgresql (I see no reason
why it wouldn't be) but I'd bet that it'll confuse or break some third
party tools.

Cheers,
  Steve

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux