pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Allow generalized expression syntax for partition bounds
4+ messages / 3 participants
[nested] [flat]

* pgsql: Allow generalized expression syntax for partition bounds
@ 2019-01-25 10:37 Peter Eisentraut <peter@eisentraut.org>
  2019-01-26 02:04 ` Re: pgsql: Allow generalized expression syntax for partition bounds Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter Eisentraut @ 2019-01-25 10:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Allow generalized expression syntax for partition bounds

Previously, only literals were allowed.  This change allows general
expressions, including functions calls, which are evaluated at the
time the DDL command is executed.

Besides offering some more functionality, it simplifies the parser
structures and removes some inconsistencies in how the literals were
handled.

Author: Kyotaro Horiguchi, Tom Lane, Amit Langote
Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/9f88b5e0-6da2-5227-20d0-0d7012beaa1c@lab.ntt.co.jp/

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7c079d7417a8f2d4bf5144732e2f85117db9214f

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml          |   6 +-
doc/src/sgml/ref/create_table.sgml         |  19 +--
src/backend/commands/tablecmds.c           |   9 ++
src/backend/optimizer/util/clauses.c       |   4 +-
src/backend/parser/gram.y                  |  60 +-------
src/backend/parser/parse_agg.c             |  10 ++
src/backend/parser/parse_expr.c            |   5 +
src/backend/parser/parse_func.c            |   3 +
src/backend/parser/parse_utilcmd.c         | 213 +++++++++++++++++++----------
src/include/optimizer/clauses.h            |   3 +
src/include/parser/parse_node.h            |   1 +
src/include/utils/partcache.h              |   6 +
src/test/regress/expected/create_table.out |  91 +++++++++---
src/test/regress/sql/create_table.sql      |  51 ++++++-
14 files changed, 314 insertions(+), 167 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: Allow generalized expression syntax for partition bounds
  2019-01-25 10:37 pgsql: Allow generalized expression syntax for partition bounds Peter Eisentraut <peter@eisentraut.org>
@ 2019-01-26 02:04 ` Michael Paquier <michael@paquier.xyz>
  2019-01-26 02:53   ` Re: pgsql: Allow generalized expression syntax for partition bounds Amit Langote <amitlangote09@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Paquier @ 2019-01-26 02:04 UTC (permalink / raw)
  To: Peter Eisentraut <peter@eisentraut.org>; +Cc: pgsql-committers@lists.postgresql.org

On Fri, Jan 25, 2019 at 10:37:22AM +0000, Peter Eisentraut wrote:
> Allow generalized expression syntax for partition bounds
> 
> Previously, only literals were allowed.  This change allows general
> expressions, including functions calls, which are evaluated at the
> time the DDL command is executed.
> 
> Besides offering some more functionality, it simplifies the parser
> structures and removes some inconsistencies in how the literals were
> handled.

fulmar, magpie and treepie are unhappy after this commit, and all of
them have the same complaint related to the order consistency of
partitions showing up in psql:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=magpie&dt=2019-01-25%2011%3A04%3A07

    Partition key: LIST (a)
-Partitions: part_1 FOR VALUES IN (1),
+Partitions: part_null FOR VALUES IN (NULL),
+            part_1 FOR VALUES IN (1),
             part_2 FOR VALUES IN (2),
-            part_3 FOR VALUES IN (3),
-            part_null FOR VALUES IN (NULL)
+            part_3 FOR VALUES IN (3)
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: Allow generalized expression syntax for partition bounds
  2019-01-25 10:37 pgsql: Allow generalized expression syntax for partition bounds Peter Eisentraut <peter@eisentraut.org>
  2019-01-26 02:04 ` Re: pgsql: Allow generalized expression syntax for partition bounds Michael Paquier <michael@paquier.xyz>
@ 2019-01-26 02:53   ` Amit Langote <amitlangote09@gmail.com>
  2019-01-26 03:04     ` Re: pgsql: Allow generalized expression syntax for partition bounds Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 4+ messages in thread

From: Amit Langote @ 2019-01-26 02:53 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Peter Eisentraut <peter@eisentraut.org>; pgsql-committers@lists.postgresql.org

On Sat, Jan 26, 2019 at 11:05 Michael Paquier <michael@paquier.xyz> wrote:

> On Fri, Jan 25, 2019 at 10:37:22AM +0000, Peter Eisentraut wrote:
> > Allow generalized expression syntax for partition bounds
> >
> > Previously, only literals were allowed.  This change allows general
> > expressions, including functions calls, which are evaluated at the
> > time the DDL command is executed.
> >
> > Besides offering some more functionality, it simplifies the parser
> > structures and removes some inconsistencies in how the literals were
> > handled.
>
> fulmar, magpie and treepie are unhappy after this commit, and all of
> them have the same complaint related to the order consistency of
> partitions showing up in psql:
>
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=magpie&dt=2019-01-25%2011%3A04%3A07
>
>     Partition key: LIST (a)
> -Partitions: part_1 FOR VALUES IN (1),
> +Partitions: part_null FOR VALUES IN (NULL),
> +            part_1 FOR VALUES IN (1),
>              part_2 FOR VALUES IN (2),
> -            part_3 FOR VALUES IN (3),
> -            part_null FOR VALUES IN (NULL)
> +            part_3 FOR VALUES IN (3)


Have sent the patch on the -hackers thread for this patch after Tom pointed
out one of these failures.

Thanks,
Amit

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: Allow generalized expression syntax for partition bounds
  2019-01-25 10:37 pgsql: Allow generalized expression syntax for partition bounds Peter Eisentraut <peter@eisentraut.org>
  2019-01-26 02:04 ` Re: pgsql: Allow generalized expression syntax for partition bounds Michael Paquier <michael@paquier.xyz>
  2019-01-26 02:53   ` Re: pgsql: Allow generalized expression syntax for partition bounds Amit Langote <amitlangote09@gmail.com>
@ 2019-01-26 03:04     ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2019-01-26 03:04 UTC (permalink / raw)
  To: Amit Langote <amitlangote09@gmail.com>; +Cc: Peter Eisentraut <peter@eisentraut.org>; pgsql-committers@lists.postgresql.org

On Sat, Jan 26, 2019 at 11:53:17AM +0900, Amit Langote wrote:
> Have sent the patch on the -hackers thread for this patch after Tom
> pointed out one of these failures.

And I have commented on the patch.  I noticed the thread on -hackers
after going through the commits.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2019-01-26 03:04 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 10:37 pgsql: Allow generalized expression syntax for partition bounds Peter Eisentraut <peter@eisentraut.org>
2019-01-26 02:04 ` Michael Paquier <michael@paquier.xyz>
2019-01-26 02:53   ` Amit Langote <amitlangote09@gmail.com>
2019-01-26 03:04     ` Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox