Thread: cannot create sequence

cannot create sequence

From
Olaf Marc Zanger
Date:
hi there,


as it seems postgresql 7.0 has trouble to create

ver_id_seq

and 

own_id_seq

there is nothing visible with \dt \ds \di

are these names occupied for other use?

thanks for help 

olaf


-- 
soli-con Engineering Zanger, Dipl.-Ing. (FH) Olaf Marc Zanger
Lorrainestrasse 23, 3013 Bern / Switzerland
fon:+41-31-332 9782, mob:+41-76-572 9782
mailto:olaf.zanger@soli-con.com, http://www.soli-con.com


Re: cannot create sequence

From
Peter Eisentraut
Date:
Olaf Marc Zanger writes:

> as it seems postgresql 7.0 has trouble to create
>
> ver_id_seq

Define "trouble".

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



Re: cannot create sequence

From
Olaf Zanger
Date:
hi there,

trouble means:

it doesn't show ver_id_seq, nor own_id_seq when doing a \ds
but it brings up an error "cannot create sequence) if i want to 
create table ver (id serial, ...);

this happend after i mistakenly did 
create table cng (id serial, ver_id int4 constraint ver_id_cst reference ver (id));

without having 
create table ver (id serial, ...);

this happend twice. the cli and ver now are nono's for my database.

thanks for help

olaf

Peter Eisentraut schrieb:
> 
> Olaf Marc Zanger writes:
> 
> > as it seems postgresql 7.0 has trouble to create
> >
> > ver_id_seq
> 
> Define "trouble".
> 
> --
> Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/

-- 
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Marc Zanger
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:info@soli-con.com
mailto:olaf.zanger@soli-con.com
http://www.soli-con.com


Re: cannot create sequence

From
Tom Lane
Date:
Olaf Zanger <olaf.zanger@soli-con.com> writes:
> it doesn't show ver_id_seq, nor own_id_seq when doing a \ds
> but it brings up an error "cannot create sequence) if i want to 
> create table ver (id serial, ...);

What is the *exact* text of the error message?  (That ain't it.)

I am guessing that a Unix file matching the desired sequence name got
left around in your database directory, and that removing this file
would allow you to create the sequence.  However, I can't duplicate
any such problem by following the procedure you describe in 7.0.2...
        regards, tom lane


Re: cannot create sequence

From
Olaf Zanger
Date:
hi there,

good guess, they are still there.

can i just delete them?

olaf

Tom Lane schrieb:
> 
> Olaf Zanger <olaf.zanger@soli-con.com> writes:
> > it doesn't show ver_id_seq, nor own_id_seq when doing a \ds
> > but it brings up an error "cannot create sequence) if i want to
> > create table ver (id serial, ...);
> 
> What is the *exact* text of the error message?  (That ain't it.)
> 
> I am guessing that a Unix file matching the desired sequence name got
> left around in your database directory, and that removing this file
> would allow you to create the sequence.  However, I can't duplicate
> any such problem by following the procedure you describe in 7.0.2...
> 
>                         regards, tom lane

-- 
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Marc Zanger
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:info@soli-con.com
mailto:olaf.zanger@soli-con.com
http://www.soli-con.com


Re: cannot create sequence

From
Olaf Zanger
Date:
um, sorry,
forgot to ask

then this is a bug eh :-¦ ?

olaf

Tom Lane schrieb:
> 
> Olaf Zanger <olaf.zanger@soli-con.com> writes:
> > it doesn't show ver_id_seq, nor own_id_seq when doing a \ds
> > but it brings up an error "cannot create sequence) if i want to
> > create table ver (id serial, ...);
> 
> What is the *exact* text of the error message?  (That ain't it.)
> 
> I am guessing that a Unix file matching the desired sequence name got
> left around in your database directory, and that removing this file
> would allow you to create the sequence.  However, I can't duplicate
> any such problem by following the procedure you describe in 7.0.2...
> 
>                         regards, tom lane

-- 
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Marc Zanger
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:info@soli-con.com
mailto:olaf.zanger@soli-con.com
http://www.soli-con.com


Re: cannot create sequence

From
Tom Lane
Date:
Olaf Zanger <olaf.zanger@soli-con.com> writes:
> good guess, they are still there.

> can i just delete them?

Yes, if there's not any corresponding system-catalog entry for them.
        regards, tom lane