Re: BUG #6226: Broken foreign key stored on database (parent deleted with children still readable, BUG#6225 Update)

Поиск
Список
Период
Сортировка
От Daniel Cristian Cruz
Тема Re: BUG #6226: Broken foreign key stored on database (parent deleted with children still readable, BUG#6225 Update)
Дата
Msg-id CACffM9GNDyQ8czxTPc5Y7A5cY5EudgUnmz5bfB1vitBtRRkD-w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #6226: Broken foreign key stored on database (parent deleted with children still readable, BUG#6225 Update)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #6226: Broken foreign key stored on database (parent deleted with children still readable, BUG#6225 Update)  (Daniel Cristian Cruz <danielcristian@gmail.com>)
Список pgsql-bugs
Thanks, Tom. Now I got it.

I didn't tryed to change BEFORE to AFTER, but reminded something I learned
coding triggers a long time ago, and I forgot. This could be a fortune:

"The rough rule of thumb is that BEFORE triggers are good for adjusting
the contents of the row that's about to be stored, while AFTER triggers
are what to use to propagate changes elsewhere."

And the full version (from manual):

"Typically, row-level BEFORE triggers are used for checking or modifying the
data that will be inserted or updated. For example, a BEFORE trigger might
be used to insert the current time into a timestamp column, or to check that
two elements of the row are consistent. Row-level AFTER triggers are most
sensibly used to propagate the updates to other tables, or make consistency
checks against other tables. The reason for this division of labor is that
an AFTER trigger can be certain it is seeing the final value of the row,
while a BEFOREtrigger cannot; there might be other BEFORE triggers firing
after it. If you have no specific reason to make a trigger BEFORE or AFTER,
the BEFORE case is more efficient, since the information about the operation
doesn't have to be saved until end of statement."

I became a rusty DBA poluting pgsql-bugs, sorry. RTFM for myself. :)
--=20
Daniel Cristian Cruz
=E3=82=AF=E3=83=AB=E3=82=BA =E3=82=AF=E3=83=AA=E3=82=B9=E3=83=81=E3=82=A2=
=E3=83=B3 =E3=83=80=E3=83=8B=E3=82=A8=E3=83=AB

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: BUG #6233: pg_dump hangs with Access Violation C0000005
Следующее
От: "Stefan Franke"
Дата:
Сообщение: BUG #6241: JDBC: blob doesnot work with bytea