Re: Server crashed with dense_rank on partition table.

2018-07-04 Thread Amit Langote
On 2018/07/05 9:40, Andres Freund wrote: > On 2018-07-02 17:14:14 +0900, Amit Langote wrote: >> I studied this a bit and found a bug that's causing the crash. >> >> The above mentioned commit has this hunk: >> >> @@ -1309,6 +1311,9 @@ hypothetical_dense_rank_final(PG_FUNCTION_ARGS) >>

Re: Server crashed with dense_rank on partition table.

2018-07-04 Thread Andres Freund
On 2018-07-02 17:14:14 +0900, Amit Langote wrote: > I studied this a bit and found a bug that's causing the crash. > > The above mentioned commit has this hunk: > > @@ -1309,6 +1311,9 @@ hypothetical_dense_rank_final(PG_FUNCTION_ARGS) > PG_RETURN_INT64(rank); > > osastate =

Re: Server crashed with dense_rank on partition table.

2018-07-03 Thread Andres Freund
On 2018-06-13 16:35:58 +0900, Amit Langote wrote: > Hi. > > On 2018/06/13 14:55, Michael Paquier wrote: > > On Wed, Jun 13, 2018 at 11:08:38AM +0530, Rajkumar Raghuwanshi wrote: > >> postgres=# SELECT dense_rank(b) WITHIN GROUP (ORDER BY a) FROM pagg_tab > >> GROUP BY b ORDER BY 1; > >> server

Re: Server crashed with dense_rank on partition table.

2018-07-02 Thread Amit Langote
On 2018/06/13 16:35, Amit Langote wrote: > Fwiw, I see that the crash can also occur even when using a > non-partitioned table in the query, as shown in the following example > which reuses Rajkumar's test data and query: > > create table foo (a int, b int, c text); > postgres=# insert into foo

Re: Server crashed with dense_rank on partition table.

2018-06-13 Thread Amit Langote
Hi. On 2018/06/13 14:55, Michael Paquier wrote: > On Wed, Jun 13, 2018 at 11:08:38AM +0530, Rajkumar Raghuwanshi wrote: >> postgres=# SELECT dense_rank(b) WITHIN GROUP (ORDER BY a) FROM pagg_tab >> GROUP BY b ORDER BY 1; >> server closed the connection unexpectedly >> This probably means the

Re: Server crashed with dense_rank on partition table.

2018-06-13 Thread David Rowley
On 13 June 2018 at 17:55, Michael Paquier wrote: > On Wed, Jun 13, 2018 at 11:08:38AM +0530, Rajkumar Raghuwanshi wrote: >> postgres=# SELECT dense_rank(b) WITHIN GROUP (ORDER BY a) FROM pagg_tab >> GROUP BY b ORDER BY 1; >> server closed the connection unexpectedly >> This probably means the

Re: Server crashed with dense_rank on partition table.

2018-06-12 Thread Michael Paquier
On Wed, Jun 13, 2018 at 11:08:38AM +0530, Rajkumar Raghuwanshi wrote: > postgres=# SELECT dense_rank(b) WITHIN GROUP (ORDER BY a) FROM pagg_tab > GROUP BY b ORDER BY 1; > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while

Server crashed with dense_rank on partition table.

2018-06-12 Thread Rajkumar Raghuwanshi
Hi, I am getting server crash with below query. CREATE TABLE pagg_tab (a int, b int, c text) PARTITION BY LIST(c); CREATE TABLE pagg_tab_p1 PARTITION OF pagg_tab FOR VALUES IN ('', '0001', '0002', '0003'); CREATE TABLE pagg_tab_p2 PARTITION OF pagg_tab FOR VALUES IN ('0004', '0005', '0006',