Re: Error class not found

From: "Jerason Banes" <jbanes(at)techie(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Error class not found
Date: 2002-05-29 20:06:02
Message-ID: 20020529200602.6629.qmail@mail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> y have this error
> ERROR: pg_aclcheck: class "mensajes_mensajeid_seq" not found
>
> y have this with all table width the nextval('xxx_xxx_seq'::text) option
>
>Does any one help me please ?

Simple enough. The problem is that the tables you are importing had sequences associated with them. A sequence is simply a counter that increments every time it is used. This allows, say, your primary key to be created as 1, then 2, then 3, and so on. There are two things you can do to solve this problem:

1. Change the SQL that looks like this:

"mensajeid" int4 DEFAULT nextval('mensajes_mensajeid_seq'::text)

to this:

"mensajeid" SERIAL

2. Add create sequence statements to your SQL. They look like this:

CREATE SEQUENCE mensajes_mensajeid_seq START 101;

Change the number after "START" to be the largest number already in the table plus 1.

Beware that the first option may result in a collision of sequence numbers.

i.e. I import a record with a primary key of 1. Later I insert a record and the sequence is still set to 1. As a result, the inserted record has a primary key of 1. The database rejects the inserted record due to a primary key conflict.

Hope this helps,
Jerason

--
__________________________________________
Need a good Database management solution?
http://java.dnsalias.com

--
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Browse pgsql-general by date

  From Date Subject
Next Message Vincent Stoessel 2002-05-29 20:12:51 size of units in postgresql.conf
Previous Message Darren Ferguson 2002-05-29 19:56:42 Re: Error class not found