Re: date_trunc not immutable

2018-12-15 Thread Ravi Krishna
Thanks all.  I forgot the TZ part.

Re: date_trunc not immutable

2018-12-15 Thread Vitaly Burovoy
On 2018-12-15, Adrian Klaver wrote: > On 12/15/18 3:26 PM, Ravi Krishna wrote: >> Version: PG 10.6 on AWS Linux. >> >> I am trying to create an index on function date_trunc('month',timestamp) >> >> PG is complaining that the function must be marked as IMMUTABLE. So I >> assume that date_trunc is

Re: date_trunc not immutable

2018-12-15 Thread Tom Lane
Ravi Krishna writes: > I am trying to create an index on function date_trunc('month',timestamp) > PG is complaining that the function must be marked as IMMUTABLE. The timestamptz version of it is not immutable, because its effects depend on the timezone setting: regression=# set timezone = 'Amer

Re: simple query on why a merge join plan got selected

2018-12-15 Thread Tom Lane
Vijaykumar Jain writes: > I was just playing with exploring joins and plans i came across this > create table t1(a int); > create table t2(a int); > insert into t1 select (x % 10) from generate_series(1, 10) x; > insert into t2 select (x % 100) from generate_series(1, 10) x; > ... > select

Re: date_trunc not immutable

2018-12-15 Thread Adrian Klaver
On 12/15/18 3:26 PM, Ravi Krishna wrote: Version: PG 10.6 on AWS Linux. I am trying to create an index on function date_trunc('month',timestamp) PG is complaining that the function must be marked as IMMUTABLE.  So I assume that date_trunc is not marked as immutable. Definition of immutable f

date_trunc not immutable

2018-12-15 Thread Ravi Krishna
Version: PG 10.6 on AWS Linux. I am trying to create an index on function date_trunc('month',timestamp) PG is complaining that the function must be marked as IMMUTABLE. So I assume that date_trunc is not marked as immutable. Definition of immutable from PG documentation ==

Re: simple query on why a merge join plan got selected

2018-12-15 Thread Ron
I'd run each query multiple times -- before and after disabling mergejoin -- to ensure that all the data is safely in RAM. On 12/15/2018 02:13 PM, Vijaykumar Jain wrote: Hey Guys, I was just playing with exploring joins and plans i came across this create table t1(a int); create table t2(a in

simple query on why a merge join plan got selected

2018-12-15 Thread Vijaykumar Jain
Hey Guys, I was just playing with exploring joins and plans i came across this create table t1(a int); create table t2(a int); insert into t1 select (x % 10) from generate_series(1, 10) x; insert into t2 select (x % 100) from generate_series(1, 10) x; pgtesting=> analyze t1; ANALYZE pgt

Re: new stored procedure with OUT parameters

2018-12-15 Thread Pavel Stehule
Hi út 11. 12. 2018 v 7:20 odesílatel Anton Shen <4175geo...@gmail.com> napsal: > Hi all, > > I was playing around with the stored procedure support in v11 and found > that pure OUT parameters are not supported. Is there any reason we only > support INOUT but not OUT parameters? > The procedure i