Re: Problem on pg_dump RANGE partition with expressions - Mailing list pgsql-hackers

From Yugo Nagata
Subject Re: Problem on pg_dump RANGE partition with expressions
Date
Msg-id 20180713184502.1845a326.nagata@sraoss.co.jp
Whole thread Raw
In response to Re: Problem on pg_dump RANGE partition with expressions  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: Problem on pg_dump RANGE partition with expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, 12 Jul 2018 17:44:48 +0900
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:

> > 1) Allow to appear more than once in range partition key
> > 
> > I don't understand why there is this restriction. If we have no clear reason, 
> > can we rip out this restrition?
> 
> I can't recall exactly, but back when I wrote this code, I might have been
> thinking that such a feature is useless and would actually just end up
> being a foot gun for users.
> 
> Although, I'm open to ripping it out if it's seen as being overly restrictive.

I think this way is good to resolve this, because allowing columns to appear more
than once would be harmless at least with the current partitioning methods, 
range and hash, although this is useless. 

Actually, we currenly allow same expression apears more than once in partition key
like

 create table t (i int) partition by range((i+1),(i+1));

In the past, I proposed a patch to forbid this, but this is rejected
since there is harmless and no need to restrict this.

Attached is a patch to get rid of "appears more than once" restriction.

Regards,

-- 
Yugo Nagata <nagata@sraoss.co.jp>

Attachment

pgsql-hackers by date:

Previous
From: "Kato, Sho"
Date:
Subject: RE: How to make partitioning scale better for larger numbers ofpartitions
Next
From: Yugo Nagata
Date:
Subject: Re: Temporary WAL segments files not cleaned up after an instancecrash