From: | mikeo <mikeo(at)spectrumtelecorp(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | pg_shadow constraint ? |
Date: | 2000-07-05 19:55:05 |
Message-ID: | 3.0.1.32.20000705155505.009681a0@pop.spectrumtelecorp.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
hi, i have a question about pg_shadow and constraints on it.
someone left our employ and i did a dropuser on his id. later,
when i did a pg_dump none of the tables created by him were
dumped. i added him back thru createuser so that i could do a
valid pg_dump.
i tried to create a unique index on pg_shadow on usesysid with
the intention of creating a foreign key from pg_class to the
shadow table to save me from myself. :)
<bold><color><param>0000,0000,ffff</param>create unique index
usesysid_idx on pg_shadow(usesysid);
CREATE
</color></bold>then i attempt to create a foreign key from pg_class:
<color><param>0000,0000,8080</param>alter table pg_class add constraint
fk_relowner foreign key (relowner)
references pg_shadow(usesysid);
</color>NOTICE: ALTER TABLE ... ADD CONSTRAINT will create
implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Index 'pg_shadow_name_index' does not exist
so i do a \d on pg_shadow:
<color><param>ffff,0000,0000</param>testx=# \d pg_shadow
ERROR: Index 'pg_shadow_name_index' does not exist
</color>there were no indexes on pg_shadow when i started and i don't
know why i
would be getting this index error message after creating a unique
index.
i'm guessing that i cannot create such an index on pg_shadow because it
causes
some sort of internal problems. what i wanted to do was create a "STOP"
for
attempting to drop a user if that user still owns objects? with a lot of
databases i thought it'd be easier for the system to tell me if such a
situation existed than my searching through for that info.
any suggestions would be welcome!
mikeo
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/enriched | 1.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-07-05 20:02:43 | Re: PostgreSQL 7.1 |
Previous Message | Steven Saner | 2000-07-05 19:42:22 | Need help with error |