Re: Insert into ... Select ... From ... too intelligent transaction

From: Roman Neuhauser <neuhauser(at)sigpipe(dot)cz>
To: "Rose, Juergen" <Juergen(dot)Rose(at)sag-el(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Insert into ... Select ... From ... too intelligent transaction
Date: 2005-07-21 21:48:57
Message-ID: 20050721214857.GA6520@isis.sigpipe.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

# Juergen(dot)Rose(at)sag-el(dot)com / 2005-07-21 19:11:04 +0200:
> I use some updateable views to handle my data (which are amazingly
> slow), which gives me ultimate flexibility to handle my data.
>
> there are some insert rules which use currval() to get the last
> sequence id for my data which I have to insert.
>
> The problem now is, it works fine if I do the statement via normal
> insert into satatements, even within a transaction block. So far so
> good. But If I migrate my old data via **Insert into my_new_view
> Select ... From my_old_table**, Only the last retrieved value of the
> sequences is used which blows my whole internal logic, because
> obviously I want to use the current (for that row) and not the last
> id.

What does the code look like?

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2005-07-21 22:12:26 Going to OSCON? We need your help!
Previous Message Thomas F. O'Connell 2005-07-21 21:36:20 ROW SHARE vs. ACCESS EXCLUSIVE; UPDATE vs. SELECT ... FOR UPDATE