Re: Transactions in one table
Olivier Gautherot <[email protected]> Fri, 27 Sep 2019 13:26:08 -0300
| Newsgroups | gmane.comp.db.postgresql.sql |
|---|---|
| Message-ID | <CAJ7S9TWc=g81qEO43Cxa0DnXg35WzSZZpgdcqRKHojPkO1SkFw@mail.gmail.com> |
--000000000000a197bf05938b5875 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jorge, On Fri, Sep 27, 2019 at 1:22 PM JORGE MALDONADO <[email protected]> wrote: > Hi, > > Does it make any sense to use transactions if only one DB operation is > performed in only one table? > For example, insert only one record in a "countries" table without doing > anything else in other table(s). One operation, one table, that=C2=B4s it= . > If it works, it will perform automatically a COMMIT. If it fails, it will perform a ROLLBACK. You don't gain much with atomic operations. -- Olivier Gautherot https://www.linkedin.com/in/ogautherot/ --000000000000a197bf05938b5875 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div>Hi Jorge,</div><div><br></div></div>= <div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Se= p 27, 2019 at 1:22 PM JORGE MALDONADO <<a href=3D"mailto:jorgemal1960@gm= ail.com">[email protected]</a>> wrote:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex"><div dir=3D"ltr">Hi,<div><br></div><div>Do= es it make any sense to use transactions if only one DB operation is perfor= med in only one table?</div><div>For example, insert only one record in a &= quot;countries" table without doing anything else in other table(s). O= ne operation, one table, that=C2=B4s it.</div></div></blockquote><div>=C2= =A0</div><div>If it works, it will perform automatically a COMMIT. If it fa= ils, it will perform a ROLLBACK. You don't gain much with atomic operat= ions.<br></div><div><br></div><div><br></div><div><div dir=3D"ltr"><div><di= v><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir= =3D"ltr">--</div><div dir=3D"ltr">Olivier Gautherot<div><a href=3D"https://= www.linkedin.com/in/ogautherot/" target=3D"_blank">https://www.linkedin.com= /in/ogautherot/</a><br></div></div></div></div></div></div><br></div></div>= =C2=A0</div></div></div> --000000000000a197bf05938b5875--