drop table failed to drop associated sequence

drop table failed to drop associated sequence

Post by Juan Roj » Wed, 05 Jun 2002 01:03:35



This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C20B17.A3837550
Content-Type: text/plain; charset="iso-8859-1"

Hi,
I'm running PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96.
I have a problem when I drop a table which contains a serial field. The
system drops the table but the associated sequence still remains in the
catalog, so if I want to create the table again with the same structure,
CREATE TABLE throws an error because the sequence that it's trying to create
already exists.
If somebody has the same same problem, or has the solution, please tell me.
Best regards,
Juan

________________________________________
Juan Rojas

------_=_NextPart_001_01C20B17.A3837550
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-=
1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2653.12">
<TITLE>drop table failed to drop associated sequence</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">I'm running PostgreSQL 7.2.1 on i686-pc-l=
inux-gnu, compiled by GCC 2.96.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">I have a problem when I drop a table whic=
h contains a serial field. The system drops the table but the associated se=
quence still remains in the catalog, so if I want to create the table again=
 with the same structure, CREATE TABLE throws an error because the sequence=
 that it's trying to create already exists.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">If somebody has the same same problem, or =
has the solution, please tell me.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Best regards,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Juan</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">________________________________________</=
FONT>
<BR><B><FONT SIZE=3D2 FACE=3D"Arial">Juan Rojas</FONT></B>

</P>

</BODY>
</HTML>
------_=_NextPart_001_01C20B17.A3837550--

 
 
 

drop table failed to drop associated sequence

Post by Henry Hou » Wed, 05 Jun 2002 01:40:26


--gBBFr7Ir9EOA20Yy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


> Hi,
> I'm running PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96.
> I have a problem when I drop a table which contains a serial field. The
> system drops the table but the associated sequence still remains in the
> catalog, so if I want to create the table again with the same structure,
> CREATE TABLE throws an error because the sequence that it's trying to cre=
ate
> already exists.

That's easy enough: just run a 'DROP SEQUENCE <sequence_name>' to remove the
sequence before re-creating the table. You may discover the name of the
sequence using '\ds' in psql.

--=20
Henry House
The attached file is a digital signature. See <http://romana.hajhouse.org/p=
gp>
for information.  My OpenPGP key: <http://romana.hajhouse.org/hajhouse.asc>.

--gBBFr7Ir9EOA20Yy
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8+5wMKK1cAVjXujwRAr+nAJ9DQx3xefrKkGpxkdtDUN9hHg2JPwCgycXG
+aOIFbwcff8WCME9WgVNDeg=
=9L5Q
-----END PGP SIGNATURE-----

--gBBFr7Ir9EOA20Yy--

 
 
 

1. DROP SEQUENCE Fails

DB2 NT V7.1 with FP3:

The following works:

 CREATE SEQUENCE TEST_SEQ
   START WITH 1
   INCREMENT BY 1
   MAXVALUE 32767
   NOCYCLE
   NOCACHE;

But later, the following fails:

  DROP SEQUENCE TEST_SEQ;

Failure is:

DB21034E  The command was processed as an SQL statement because it was
not a
valid Command Line Processor command.  During SQL processing it
returned:
SQL0104N  An unexpected token "SEQUENCE" was found following "DROP ".  
Expected tokens may include:  "<server_or_server_mapping>".
SQLSTATE=42601

--
====================================
To reply, delete the 'x' from my email

Jerry Stuckle
JDS Computer Training Corp.

====================================

2. pdox3.5 "not enough disk space to enter subsystem"

3. Drop table versus truncate and drop index

4. How to find Duplicate records

5. Problems dropping indexes when dropping tables

6. Problems Updating recordset

7. Scripting DROP Table *and* DROP (related) Foreign Keys...

8. essbase user management

9. Relation between DROP TABLE and DROP INDEX

10. Dropping Tables in Sequence

11. dropped table column causes sp_addmergearticle to fail with replication

12. Drop Temp Table Fails