Re: Error class not found

Поиск
Список
Период
Сортировка
От Jerason Banes
Тема Re: Error class not found
Дата
Msg-id 20020529200602.6629.qmail@mail.com
обсуждение исходный текст
Ответ на Error class not found  ("Remi" <gemegesola@retemail.es>)
Список 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
simplya counter that increments every time it is used. This allows, say, your primary key to be created as 1, then 2,
then3, 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Marcia Abade
Дата:
Сообщение: Privileges Doubts
Следующее
От: Stephen Robert Norris
Дата:
Сообщение: Re: How to cripple a postgres server