Grokbase
Topics Posts Groups | in
x
[ help ]

[Dbix-class] Probleme with nextval() and postgresql 7.4.17

View PostFlat  Thread  Threaded | < Prev
Matt S Trout [Dbix-class] Probleme with nextval() and postgresql 7.4.17
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
On Tue, Oct 07, 2008 at 10:54:30AM +0200, Ludovic Legrand wrote:
> hi,
> I want to select the nextval of the sequence 'seq_id_comparison' of the
> table 'Comparison' with this line:
>
> $dbh->resultset('Comparison')->search(undef, {
> select => "nextval('seq_id_comparison')",
>       as => 'id_comp',
>       })->single->get_column('id_comp');
> SQL equivalent:
> SELECT NEXTVAL('seq_id_comparison');
>
> The SQL statement gives last_value + 1, that's ok, while the DBIx
> request gives something like last_value + 500 ...
> How to explain this increment ?

DBIC_TRACE=1 perl myscript.pl

and see what queries you're running.

Also please note it's DBIx::Class or DBIC, DBIx:: contains lots of other
projects.

--
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
Technical Director http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/

Thread : [Dbix-class] Probleme with nextval() and postgresql 7.4.17
1)
Ludovic Legrand hi, I want to select the nextval of the sequence 'seq_id_comparison' of the table 'Comparison' with...
2)
Matt S Trout DBIC_TRACE=1 perl myscript.pl and see what queries you're running. Also please note it's...
spacer
View PostFlat  Thread  Threaded | < Prev