Do postgres use implicit transaction in UPDATE ... RETURNING queries?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can someone let me know if Postgres 15 uses implicit transactions for UPDATE...RETURNING queries?

For example, is there any differences between the two queries

BEGIN;
UPDATE counter
SET value = value + 1
RETURNING value;
COMMIT;

and

UPDATE counter
SET value = value + 1
RETURNING value;

Table is like below

CREATE TABLE IF NOT EXISTS counter
(
    value      bigint PRIMARY KEY NOT NULL DEFAULT 0,
    updated_at TIMESTAMPTZ        NOT NULL DEFAULT CURRENT_TIMESTAMP
);

[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux