Re: It is possible to update more than 1 table in the same update statement? - Mailing list pgsql-general

From Andre Lopes
Subject Re: It is possible to update more than 1 table in the same update statement?
Date
Msg-id AANLkTin6RYyhXbAuewveOrsvFBP97utJJZRCCUsfgL+X@mail.gmail.com
Whole thread Raw
In response to Re: It is possible to update more than 1 table in the same update statement?  (Scott Ribe <scott_ribe@killerbytes.com>)
Responses Re: It is possible to update more than 1 table in the same update statement?
List pgsql-general
Hi,

Thanks for the reply.

I have write the transaction, but I have some doubt's... If in this example the Update is executed successfully and the Function it is not, what happens? The Update automatically rolls back?

Example:

[code]
Begin;
update aae_anuncios
                                    set
                                    n_anunciante = 'teste',
                                    email = 'teste@email.com',
                                    telefone_privado = '123456789',
                                    dat_nasc = '1980-01-01',
                                    n_anuncio = 'teste nome',
                                    telefone_anuncio = '234567890',
                                    id_genero = 'femi',
                                    id_cidade = '1452003',
                                    id_nacionalidade = 'BRAS',
                                    id_orientacao = 'h'
                                    where id_anuncio_externo = '38';
                                   
    select apr_update_hist_2_1('aae_hist_anuncios',
    'id_anuncio_externo',
    '38', /* id_anuncio_externo */
    '2010-08-31', /* data_inicio */
    '2010-12-29', /* data_fim */
    'AA' /* Motivo: Aprovação Anúncio */
    );
commit;
[/code]

Best Regards,


On Sun, Nov 7, 2010 at 3:41 PM, Scott Ribe <scott_ribe@killerbytes.com> wrote:
On Nov 7, 2010, at 8:37 AM, Andre Lopes wrote:

> The only way I can guarantee a transaction is in a Function or there are other ways?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Full Vacuum/Reindex vs autovacuum
Next
From: Scott Marlowe
Date:
Subject: Re: It is possible to update more than 1 table in the same update statement?