Subject: | Insertion with reserved word |
Date: | Tue, 13 Oct 2009 15:03:52 +0200 |
To: | bug-DBIx-Class [...] rt.cpan.org |
From: | "Hugo Cornejo (QindelGroup)" <hugo.cornejo [...] qindel.com> |
Hi,
I'm having a little issue running DBIx with PostgreSQL. I have a table
named "user" that crashes when I try to make an insertion with
resultset('User')->create while any other table works fine.
The error,
DBIx::Class::ResultSet::create(): DBI Exception: DBD::Pg::st execute
failed: ERROR: syntax error at or near "user"
LINE 1: INSERT INTO user ( login) VALUES ( $1 )
I think user is a reserved word so DBIx must make the insert with
question marks like INSERT INTO "user" ( "login") VALUES ( $1 )
My system,
DBIx-Class-0.08112
Perl version: v5.10.0 built for x86_64-linux-gnu-thread-multi
OS version: 2.6.31-10-server #34-Ubuntu x86_64 GNU/Linux
Cheers,
Hugo
--
HUGO CORNEJO
hugo.cornejo@qindel.com
Calle Caleruega, 102-104 3º Der
28033 Madrid - Spain
Telf: +34 91 766 24 21 - Fax: +34 91 766 23 57
QindelGroup