Search Postgresql Archives

Re: Column does not exists?

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

 



On Thu, 26 Mar 2015 14:12:36 -0300
"Leonardo M. Ramé" <l.rame@xxxxxxxxxxx> wrote:

> Ok, I have this table:
> 
> CREATE TABLE sessions
> (
>    "SESSIONID" integer NOT NULL,
>    "SESSIONTIMESTAMP" character varying(45) NOT NULL,
>    "SESSIONDATA" character varying(200) DEFAULT NULL::character varying,
>    CONSTRAINT sessions_pkey PRIMARY KEY ("SESSIONID")
> )
> 
> Now, when I do:
> 
> DELETE From sessions WHERE SESSIONTIMESTAMP < '2010-01-01 10:02:02'
> 
> I get:
> 
> ERROR:  column "sessiontimestamp" does not exist
> LINE 1: DELETE From sessions WHERE SESSIONTIMESTAMP < '2010-01-01 10...
>                                     ^
> ********** Error **********
> 
> ERROR: column "sessiontimestamp" does not exist
> SQL state: 42703
> Character: 28
> 
> But if I do:
> 
> DELETE From sessions WHERE "SESSIONTIMESTAMP" < '2010-01-01 10:02:02'
> 
> It DOES work.
> 
> Why the db doesn't recognize the name of the table without quotes?.

See:
http://www.postgresql.org/docs/9.4/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

-- 
Bill Moran


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





[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