hi list

during table creation i mistakenly had a SERIAL instead of INTEGER type for
a value. i removed the default value (nextval....) for this field. still i
can't drop the old sequence:

ERROR: cannot drop sequence kinos_normal_kn_k_id_seq because table
kinos_normal column kn_k_id requires it
HINT: You may drop table kinoprogramm.kinos_normal column kn_k_id instead.

i know i may drop the field and recreate it, but this is very annoying as
views and foreign keys are already assigned to that particular field. is
there another way to drop the unused sequence?

thanks,
thomas

Search Discussions

  • Tom Lane at Jan 3, 2006 at 3:00 am

    <me@alternize.com> writes:
    during table creation i mistakenly had a SERIAL instead of INTEGER type for
    a value. i removed the default value (nextval....) for this field. still i
    can't drop the old sequence:
    Ideally, SERIAL would prevent you from munging the default expression,
    too. What you are doing represents unwarranted tampering with the
    implementation of a data type...

    Having said that, if you remove the relevant entry in pg_depend then
    you'll be able to drop the sequence.

    regards, tom lane
  • Me at Jan 3, 2006 at 3:14 am

    <me@alternize.com> writes:
    during table creation i mistakenly had a SERIAL instead of INTEGER type
    for
    a value. i removed the default value (nextval....) for this field. still
    i
    can't drop the old sequence:
    Ideally, SERIAL would prevent you from munging the default expression,
    too. What you are doing represents unwarranted tampering with the
    implementation of a data type...

    Having said that, if you remove the relevant entry in pg_depend then
    you'll be able to drop the sequence.
    thanks. i'm using EMS SQL Manager 3. when creating a SERIAL data field, it
    is shown as INTEGER afterwards with the "nextval(..)" default value. thats
    how and why i was able to make it a "pure" integer ;-)

    i'll fill a bug report at ems about this.

    thanks for your fast help,
    thomas
  • Jaime Casanova at Jan 3, 2006 at 5:33 pm

    On 1/2/06, Tom Lane wrote:
    <me@alternize.com> writes:
    during table creation i mistakenly had a SERIAL instead of INTEGER type for
    a value. i removed the default value (nextval....) for this field. still i
    can't drop the old sequence:
    Ideally, SERIAL would prevent you from munging the default expression,
    too. What you are doing represents unwarranted tampering with the
    implementation of a data type...

    Having said that, if you remove the relevant entry in pg_depend then
    you'll be able to drop the sequence.

    regards, tom lane
    why not let ALTER TYPE drop the sequence if one exists?

    --
    regards,
    Jaime Casanova
    (DBA: DataBase Aniquilator ;)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedJan 3, '06 at 2:46a
activeJan 3, '06 at 5:33p
posts4
users3
websitepostgresql.org
irc#postgresql

3 users in discussion

Me: 2 posts Jaime Casanova: 1 post Tom Lane: 1 post

People

Translate

site design / logo © 2022 Grokbase