Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: verwaiste Sequence löschen



von A. Kretschmer <andreas(dot)kretschmer(at)schollglas(dot)com> am 24.04.2007:
> select relname from pg_class where relfilenode = (select refobjid
> from pg_depend where objid='xyz_id_seq'::regclass and deptype='i');

Ich habe mal Dein Statement ausgeführt:

# object_files_description_id_seq wird definitiv verwendet
CREATE TABLE object_files_description (
  id INTEGER nextval('object_files_description_id_seq'::regclass),
  .
  .
  .
) WITH OIDS;

select relname from pg_class where relfilenode = (select refobjid from pg_depend where
objid='object_files_description_id_seq1'::regclass and deptype='i');

relname
------------------------
object_files_description

Dann mal auf die harte Tour und die Sequence aus der Tabelle entfernt!

# danach
CREATE TABLE object_files_description (
  id INTEGER,
  .
  .
  .
) WITH OIDS;

select relname from pg_class where relfilenode = (select refobjid from pg_depend where
objid='object_files_description_id_seq1'::regclass and deptype='i');

relname
------------------------
object_files_description


Ich glaube, ich werde das Schema und die Daten separat exportieren.
Aus der SQL-Datei für das Schema lösche ich die "falschen" Sequencen.
Dann lösche ich die Datenbank und importiere wieder alles... :-(


Grüße

André Laugks





Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group