Skip site navigation (1) Skip section navigation (2)

How to copy Datum

From: "Wang, Chaoyong" <Chaoyong(dot)Wang(at)emc(dot)com>
To: <pgsql-cluster-hackers(at)postgresql(dot)org>
Subject: How to copy Datum
Date: 2012-08-21 10:40:41
Message-ID: (view raw or whole thread)
Lists: pgsql-cluster-hackers


I'm trying to reduce the re-computing of window aggregation. Here the
AVG function for example.


The original window aggregation's transition value(transValue) of AVG is
an ArrayType, that contains two main values(sum, count). 


Now, I'm using a temporary transition value (tempTransValue), and I need
to copy tempTransValue to the original window aggregation's transition


I used the function datumCopy as following:

peraggstate->transValue = datumCopy(peraggstate->tempTransValue,
peraggstate->transtypeByVal, peraggstate->transtypeLen);


But when the copied transValue is passed to the invoke function, here is
int4_avg_accum, the ArrayType returned from PG_GETARG_ARRAYTYPE_P(0) is

Which means the copy action is failed.


Anybody know why? Or give me some suggestions? Thanks very much.



Best Regards

Chaoyong Wang


pgsql-cluster-hackers by date

Next:From: Nicolas BarbierDate: 2012-08-22 09:29:42
Subject: Re: How to copy Datum
Previous:From: Magnus HaganderDate: 2012-08-06 09:53:19
Subject: Re: postgres 9 bind address for replication

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group