Please ignore this message, I have fixed the issue. Regards,
----- Original Message ---- > From: Peter Shangov <[email protected]> > To: [email protected] > Sent: Wed, 7 July, 2010 13:22:55 > Subject: prepending Pg schema name in queries > > Hi, > > I have the following schema class to access the 'user' table from the > 'materials' schema in a PostgreSQL database: > > package ADP::Schema::Materials::Result::User; > use base 'DBIx::Class::Core'; > __PACKAGE__->table("materials.user"); > ... > > Later on, the following code: > > my $schema = ADP::Schema::Materials->connect( ... ); > my $rs = $schema->resultset('User')->all; > > produces an error: > > DBI Exception: DBD::Pg::st execute failed: ERROR: column notation .user_id > applied to type name, which is not a composite type > LINE 1: SELECT me.user_id, me.username, me.name, me.name_local, me.e... > ^ [for Statement "SELECT me.user_id, me.username, me.name, > me.name_local, me.email, me.active, me.cms2_id, me.cms3_id, me.wordpress_id >FROM > user me"] at C:/strawberry/perl/site/lib/DBIx/Class/Schema.pm line 1026 > > This error is due to the fact that 'user' is a reserved word and "SELECT ... > FROM user" fails. How can I force DBIx::Class to prepend the schema name to >the > > table in the query, to get "SELECT ... FROM materials.user"? > > Regards, > > _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
