Re: Postgres code for a query intermediate dataset

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Rohit Goyal <rhtgyl(dot)87(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Postgres code for a query intermediate dataset
Date: 2014-09-13 17:53:14
Message-ID: CAOeZVicef5+6TfLnTYdmD1vFopAJ7FRAqpoTbAPZJHnKSE1Vhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 13, 2014 at 11:06 PM, Rohit Goyal <rhtgyl(dot)87(at)gmail(dot)com> wrote:

>
> Hi All,
>
> I want to work on the code of intermediate dataset of select and update
> query.
>
> For example.
>
> Rohit's salary has been updated 4 times, so it has 4 different version of
> salary.
>
> I want to select salary of person named Rohit. Now suppose , in
> intermediate result, I found 4 different versions of the data. I want to
> know the code portion which i need to look for working on all 4 versions in
> dataset. :)
>
> Thanks in advance!!
>
>
>
Not sure what you are looking for, but each update is an insert of a new
tuple with the new values and marking the old tuple as deleted.

There is no need for tracking the versions of any changes in data set. Each
update operation leaves only one visible tuple. If the transaction commits,
inserted tuple becomes visible and old row is marked deleted. If the
transaction rollbacks, only the old tuple shall remain visible.
--
Regards,

Atri
*l'apprenant*

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G Johnston 2014-09-13 18:22:47 Re: Postgres code for a query intermediate dataset
Previous Message Rohit Goyal 2014-09-13 17:36:11 Postgres code for a query intermediate dataset