Search Postgresql Archives

Re: select statement sorting

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

 



On Wednesday 31 March 2004 16:31, 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?

SELECT first_name FROM foo ORDER BY lower(first_name)

Of course, then you can't guarantee whether you get "Alex" then "alex" or the 
other way around, so you might want:

SELECT first_name FROM foo ORDER BY lower(first_name), first_name


> 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?

You need to quote the names to create them this way. If you do so, you need to 
quote them when you use them, so:

CREATE MyTable / SELECT FROM mytable/MYTABLE/MyTaBle...
CREATE "MyTable" / SELECT FROM "MyTable"

-- 
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly

[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