Re: order of rows in update
От | Richard Broersma |
---|---|
Тема | Re: order of rows in update |
Дата | |
Msg-id | 396486430809020724v4617b75eg5c00a233581eba30@mail.gmail.com обсуждение исходный текст |
Ответ на | order of rows in update (Achilleas Mantzios <achill@matrix.gatewaynet.com>) |
Ответы |
Re: order of rows in update
|
Список | pgsql-sql |
On Tue, Sep 2, 2008 at 2:58 AM, Achilleas Mantzios <achill@matrix.gatewaynet.com> wrote: > is there an (implicit) way to make a multirow update execute on some rows prior to other rows? > It is needed in a case where a trigger is defined on the table as FOR EACH ROW, and it is mandatory > that the trigger is run for some certain rows before it is run on the rest of the rows. > > Is there anything reliable to achieve this without making poor assumptions of the future > versions, or should i just "SELECT ... ORDER BY ..." and then perform individual UPDATEs? The only way that I know how to do this is to create a named cursor of the rows that you want to update, and then for each record call UPDATE ... FROM ... WHERE CURRENT OF cursorname; But why are you even having this problem to begin with? What you are describing sounds like a database normalization problem. -- Regards, Richard Broersma Jr. Visit the Los Angeles PostgreSQL Users Group (LAPUG) http://pugs.postgresql.org/lapug
В списке pgsql-sql по дате отправления: