[freeside-users] duplicate key violates unique constraint "cust_main_pkey"

Ivan Kohler ivan at sisd.com
Wed Sep 5 15:15:47 PDT 2007


Take a look at bin/sequences.reset, it sets each primary key sequence to the current 
highest value in the table.

(SQL syntax is something like: SELECT SETVAL('sequence_name', value);

-- 
_ivan


On Wed, Sep 05, 2007 at 12:24:51PM -0500, Vlad Sedov wrote:
> hey folks....
> 
> 
> long time without problems. here's what I've got today:
> 
> 
> duplicate key violates unique constraint "cust_main_pkey"
> 
> 
> I understand what the error means and what's causing it - somehow the next
> value of the cust_main_custnum_seq bumps into an existing custnum. Is it
> possible to "reset" the sequence's next value to an arbitrary number? I
> don't know postgres well enough to figure it out.
> 
> 
> FS 1.7.0, apache 1.3, postgres 8.1.4
> 
> 
> 
> Vlad

> _______________________________________________
> freeside-users mailing list
> freeside-users at sisd.com
> http://420.am/cgi-bin/mailman/listinfo/freeside-users


-- 
_ivan


More information about the freeside-users mailing list