Thomas G. Lockhart wrote:
>
> Back to your question: Postgres probably does not remove trigger
> functions if a table is destroyed, but that isn't a problem if the
> trigger function is generic code which will be reused anyway.
Both functions in spi/refint.c are generic ones. They should be
part of core system, not of contrib, to be used for FOREIGN KEY
in CREATE TABLE...
No problems with using them.
>
> Vadim has been thinking about how to do foreign keys, but I can't
> remember if it was via triggers or some other means.
^^^^^^^^^^^^
No. Via indices.
Vadim