[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-bugs] [Gnumed-devel] 1.0.rc5 release

From: Jim Busser
Subject: Re: [Gnumed-bugs] [Gnumed-devel] 1.0.rc5 release
Date: Fri, 07 Oct 2011 07:47:18 -0700

On 2011-10-06, at 11:53 PM, Karsten Hilbert wrote:

> On Thu, Oct 06, 2011 at 06:19:31PM -0700, Jim Busser wrote:
>> After setting pk=10 to pk=9, I can now not update because I lack pk=10.
> I thought you would have set fk_data_source to 10 rather
> then changing to 9.

Well, I wanted to clone a LOINC record. Would there have been an easier way 

                \COPY (SELECT the existing LOINC record from ref.data_source, 
which I had reverted to pk=9) TO a tempfile

except that I could not then

                \COPY ref.data_source FROM tempfile

because of what would have been duplicated (pk=9 and version =2.6). Therefore, 
what I did – and BTW I had a typo in what I last emailed – was:

        - temporarily set pk=10
        - exported where pk=10 (that was the typo, where I should have written 
pk=10 not pk=9)
        - set the current record back to pk=9 and also decremented the version 
2.6 with fake 2.59
        - imported from tempfile the LOINC which had pk=10 and version=2.6

Of course, it is a hack, which required that I knew which pk was having to be 
fixed and I also knew that version = 2.6 was unique to the row at issue. A 
fixup script would need to look up the pk affecting LOINC (and I gather ATC as 

-- Jim

reply via email to

[Prev in Thread] Current Thread [Next in Thread]