[Dbix-class] Re: Postgresql delimiter problem

Dagfinn Ilmari Mannsåker ilmari at ilmari.org
Sun May 26 19:35:37 GMT 2013


Mario Minati <Mario.Minati at minati.de> writes:

> Hello,
>
> I've an interesting problem with delimiters with Postgresql:
[snip]
> DBI Exception: DBD::Pg::st execute failed: ERROR:  column "ID" does not exist
> LINE 1: ... INTO "changeset" ( "set_date") VALUES ( $1 ) RETURNING "ID"
>                                                                    ^ [for Statement "INSERT INTO "changeset" ( "set_date") VALUES ( ? ) RETURNING "ID"" with ParamValues: 1='2013-05-26 19:05:20'] at /usr/local/share/perl/5.14.2/DBIx/Class/Schema.pm line 1080.
>
> The problem is on "ID".

Identifiers are case sensitive in PostgreSQL, but unquoted ones are
folded to lower case. This means that if you didn't quote name of the
column when you created the table, it will have been created as "id",
but the query uses "ID", which is not the same name.

> Any ides what switch in postgresql could be the one?

There is no switch in PostgreSQL, you need to make sure your casing and
quoting is consistent between creating and using the scheem.

-- 
"I use RMS as a guide in the same way that a boat captain would use
 a lighthouse.  It's good to know where it is, but you generally
 don't want to find yourself in the same spot." - Tollef Fog Heen




More information about the DBIx-Class mailing list