Q: Rename constraint

Поиск
Список
Период
Сортировка
Искать

Q: Rename constraint

От:
Tilo Schwarz <mail@tilo-schwarz.de>
Дата:
Hi,

I want to rename several constraints. But I didn't find a way to rename a 
constraint (eg. a foreign key constraint) except of dropping and recreating 
it (with alter table) - am I right?

Now my question is, if I can directly change the value of 
"pg_constraint.conname", or am I calling for trouble that way?

Thanks and regards,

	Tilo

Re: Q: Rename constraint

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Tilo Schwarz  writes:
> Now my question is, if I can directly change the value of 
> "pg_constraint.conname", or am I calling for trouble that way?

If it's a foreign-key constraint, I think you'd also need to update
pg_trigger.tgconstrname for the triggers belonging to the constraint.

			regards, tom lane
FAQ