On Mon, 7 Aug 2006 08:40:26 +0100 (BST), Jess wrote:
>> Caught exception in Myapp::Controller::User->create
>> "DBIx::Class::ResultSet::create(): Can't get last insert id at
>> /var/www/Myapp/script/../lib/Myapp/Controller/User.pm
>> line 71"
[...]
>> DBD::Pg::db last_insert_id failed: no statement executing
> Are you setting the "sequence" key in your column_info?
-> add_columns('myidfield' => { sequence => 'seqname' } .. ?
No I wasn't; I will try... Well, if I print out $seq in
DBIx::Class::Storage::DBI::Pg::last_insert_id it is
'public.user_id_seq' whether I add the sequence to the column_info
myself or not, so the automation there works.
Ah, it was a simple user-error. My mistake was that the user which
connects to the database did not have permission to SELECT on the
sequence, so permission was denied and it didn't work.
As soon as I GRANT SELECT rights to the user, it works smoothly.
DBD::Pg's error message isn't the clearest in the world, but... I was
being stupid.
I apologize for the noise,
Adam
--
"Subdued flamboyance" Adam Sjøgren
[EMAIL PROTECTED]
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/