Search Postgresql Archives

Problem removing Sequence in Postgresql 8.0.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi 

I'm trying to remove a sequence from my production database (postgresql
8.0.3 running on RHEL4 PowerPC), but am getting an error that doesn't
make sense. When I run:

      DROP SEQUENCE tbl_id_seq1 RESTRICT;

I get the following error:

      ERROR:  cannot drop sequence tbl_id_seq1 because table tbl column
      id requires it
      HINT:  You may drop table tbl column id instead.


but I have updated the table to use the sequence tbl_id_seq.

      mydb=# \d tbl
      Table "public.tbl"
        Column  |         Type         |                    Modifiers
      ----------+----------------------+-------------------------------------------------
       id       | integer              | not null default
       nextval('tbl_id_seq'::text)
       code     | character(6)         | not null
       business | character varying    | not null
       h_indx   | character varying(2) | not null
      Indexes:
         "tbl_pkey" PRIMARY KEY, btree (id)
         "tbl_business_key" UNIQUE, btree (code)
       
And if I check the tables using this sequence, I get nothing:


      mydb=# SELECT p.relname, a.adsrc FROM pg_class p JOIN pg_attrdef a
      ON (p.relfilenode = a.adrelid) WHERE a.adsrc ~ 'tbl_id_seq1';
        relname | adsrc
       ---------+-------
       (0 rows)

Can anyone suggest how I might remove this sequence from my database (I
would like to avoid dropping and then recreating the table tbl)?


Thanks
Adam
-- 
  That Fat Guy
  thatfatguy@xxxxxxxxxxx

-- 
http://www.fastmail.fm - IMAP accessible web-mail


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux