Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Date: 2014-10-28 00:37:44
Message-ID: CAM3SWZSq8q3X31LuKODRREuc77no6DLXj6XTTPz9w4-Puf-r8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> ---
> doc/src/sgml/ddl.sgml | 23 +++
> doc/src/sgml/indices.sgml | 11 +-
> doc/src/sgml/mvcc.sgml | 43 ++++--
> doc/src/sgml/plpgsql.sgml | 20 ++-
> doc/src/sgml/postgres-fdw.sgml | 8 ++
> doc/src/sgml/ref/create_index.sgml | 7 +-
> doc/src/sgml/ref/create_rule.sgml | 6 +-
> doc/src/sgml/ref/create_table.sgml | 5 +-
> doc/src/sgml/ref/create_trigger.sgml | 5 +-
> doc/src/sgml/ref/create_view.sgml | 36 ++++-
> doc/src/sgml/ref/insert.sgml | 258 ++++++++++++++++++++++++++++++++--
> doc/src/sgml/ref/set_constraints.sgml | 6 +-
> doc/src/sgml/trigger.sgml | 46 ++++--
> 13 files changed, 426 insertions(+), 48 deletions(-)
>
> #1 internal documentation stats:
>
> doc/src/sgml/indexam.sgml | 133 ++++++++++++++++++++++++++++++++++++---
> src/backend/access/nbtree/README | 90 +++++++++++++++++++++++++-
> src/backend/executor/README | 35 +++++++++++
> 3 files changed, 247 insertions(+), 11 deletions(-)
>
> #2 internal documentation stats:
>
> ---
> src/backend/executor/README | 49 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)

Just to put that in context, here are the documentation changes from
the original LATERAL commit:

doc/src/sgml/keywords.sgml | 2 +-
doc/src/sgml/queries.sgml | 83
+++++++++++++++++++++++++++++++++++++++++-
doc/src/sgml/ref/select.sgml | 102
+++++++++++++++++++++++++++++++++++++++++++++-------

Commit 0ef0b30 added data-modifying CTE docs (docs only). That looks like:

doc/src/sgml/queries.sgml | 177
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
doc/src/sgml/ref/select.sgml | 49 ++++++++++++++---
2 files changed, 214 insertions(+), 12 deletions(-)

> Have I not provided a total of 4 isolation tests illustrating
> interesting concurrency/visibility interactions? That's a lot of
> isolation tests. Here is the tests commit stat:
>
> 31 files changed, 1159 insertions(+), 8 deletions(-)

And to put the tests in context, here are the stats from the original
Hot Standby commit:

src/test/regress/expected/hs_standby_allowed.out | 215
++++++++++++++++++++++++++
src/test/regress/expected/hs_standby_check.out | 20 +++
src/test/regress/expected/hs_standby_disallowed.out | 137 +++++++++++++++++
src/test/regress/expected/hs_standby_functions.out | 40 +++++
src/test/regress/pg_regress.c | 33 ++--
src/test/regress/sql/hs_primary_extremes.sql | 74 +++++++++
src/test/regress/sql/hs_primary_setup.sql | 25 +++
src/test/regress/sql/hs_standby_allowed.sql | 121 +++++++++++++++
src/test/regress/sql/hs_standby_check.sql | 16 ++
src/test/regress/sql/hs_standby_disallowed.sql | 105 +++++++++++++
src/test/regress/sql/hs_standby_functions.sql | 24 +++
src/test/regress/standby_schedule | 21 +++

So (at least as measured by raw lines of tests), this feature is
better tested than the original Hot Standby commit, and by a wide
margin. Tests also serve as an explanatory tool for the feature (in
particular, isolation tests can be used in this way).
--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-10-28 00:54:05 Re: Reducing the cost of sinval messaging
Previous Message Noah Misch 2014-10-28 00:33:56 Re: Reducing lock strength of adding foreign keys