Re: Partition key causes problem for volatile target list query

2023-01-26 Thread Bruce Momjian
On Thu, Jan 26, 2023 at 07:21:16PM -0500, Tom Lane wrote: > Well, if you looked further than the first few rows, it wouldn't be > "always zero". But the select from the partitioned table will read > the first partition first, and that partition will have the rows > with d1=0, by definition. > > =

Re: Partition key causes problem for volatile target list query

2023-01-26 Thread Tom Lane
Bruce Momjian writes: > I have found an odd behavior --- a query in the target list that assigns > to a partitioned column causes queries that would normally be volatile > to return always zero. Well, if you looked further than the first few rows, it wouldn't be "always zero". But the select fro

Partition key causes problem for volatile target list query

2023-01-26 Thread Bruce Momjian
I have found an odd behavior --- a query in the target list that assigns to a partitioned column causes queries that would normally be volatile to return always zero. In the first query, no partitioning is used: d1 | d2 + 1 | 0 2 | 0 2 | 1