#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Posts
    286
    Rep Power
    13

    converting queries to lower case


    I'm new to postgreSQL, and I've run across a strange problem. I've got a table structire as below
    staffId
    userName
    password

    When I try and run a query:
    SELECT staffId,userName,password FROM staff WHERE userName='xxxx'

    I get the follwing error
    ERROR: Attribute staffid not found

    It seems that postgres is converting the query to lower case. I can get around this by surronding the columns name with ' or by renaming the columns to all lowercase, however I would prefer not to do this.
    I'm connecting to the database engine through PHP. Is there a way and can change this behaviour.
    I'm running PostgreSQL on Redhat 8.0, 7.2.2, pretty much the default distribution that came with redhat.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    Paris Uppland
    Posts
    2,383
    Rep Power
    391
    Use " e.g.

    Code:
    select "staffId"

IMN logo majestic logo threadwatch logo seochat tools logo