Re: [HACKERS] lag(bigint,int,int), etc?

2017-06-27 Thread Merlin Moncure
On Tue, Jun 27, 2017 at 10:12 AM, Colin 't Hart wrote: > On 27 Jun 2017, at 17:06, Merlin Moncure wrote: >> >>> On Tue, Jun 27, 2017 at 10:01 AM, Colin 't Hart >>> wrote: >>> Hi, >>> >>> The following rather contrived example illustrates that lag(), lead() >>> (and probably other functions) can

Re: [HACKERS] lag(bigint,int,int), etc?

2017-06-27 Thread Colin 't Hart
On 27 Jun 2017, at 17:06, Merlin Moncure wrote: > >> On Tue, Jun 27, 2017 at 10:01 AM, Colin 't Hart wrote: >> Hi, >> >> The following rather contrived example illustrates that lag(), lead() >> (and probably other functions) can't automatically cast an integer to >> a bigint: >> >> select lag(

Re: [HACKERS] lag(bigint,int,int), etc?

2017-06-27 Thread Merlin Moncure
On Tue, Jun 27, 2017 at 10:01 AM, Colin 't Hart wrote: > Hi, > > The following rather contrived example illustrates that lag(), lead() > (and probably other functions) can't automatically cast an integer to > a bigint: > > select lag(sum,1,0) over () from (select sum(generate_series) over > (order

[HACKERS] lag(bigint,int,int), etc?

2017-06-27 Thread Colin 't Hart
Hi, The following rather contrived example illustrates that lag(), lead() (and probably other functions) can't automatically cast an integer to a bigint: select lag(sum,1,0) over () from (select sum(generate_series) over (order by generate_series) from generate_series(1,10)) x; ERROR: function l