gnumed-bugs
[Top][All Lists]
Advanced

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

Re: [Gnumed-bugs] Fixup Server failed


From: Karsten Hilbert
Subject: Re: [Gnumed-bugs] Fixup Server failed
Date: Thu, 5 Sep 2019 12:46:26 +0200

> that's why I love GNUmed. Easy solution - and I've learned something.
> 
> SET default_transaction_read_only to off;
> BEGIN;
> ALTER TABLE gm.access_log DROP CONSTRAINT access_log_pkey CASCADE;
> DROP INDEX if exists gm.access_log_pkey CASCADE;
> SELECT * FROM gm.access_log WHERE pk = 67314;
> DELETE FROM gm.access_log WHERE pk_audit = 593072;
> REINDEX TABLE gm.access_log;
> 
> that's what solved it!
> 
> I had to drop the other line, otherwise I somehow got the same error
> again.

Well, that last line "ROLLBACK" was there to make sure you
test things first non-destructively.

The next step would have been to re-run the above with

COMMIT;

appended :-)

Or, one could have refined the script to keep the deleted line
as a new line such as not to lose it's content (which is just
a log of one EMR access). Things will run fine w/o it, though.
The deletion is also logged in the audit system ;-)

We should now re-enable the index and primary key:

What does

 \df+ gm.access_log

show ATM ?

Karsten



 now gm_fixup_server ran without problems.
> 
> Thanks
> 
> 
> Am 04.09.19 um 22:54 schrieb Karsten Hilbert:
> > On Wed, Sep 04, 2019 at 12:22:43PM +0200, address@hidden wrote:
> >
> >>  pk_audit | row_version |         modified_when         | modified_by | 
> >> pk   |                  user_action                 
> >> ----------+-------------+-------------------------------+-------------+-------+-----------------------------------------------
> >>    593072 |           0 | 2019-07-23 06:08:28.608499+00 | maan        |
> >> 67314 | EMR access: pulling chart for identity [9670]
> >>    593079 |           0 | 2019-07-23 06:26:59.141724+00 | maan        |
> >> 67314 | EMR access: pulling chart for identity [9672]
> >> (2 rows)
> > One might simply delete one of the rows:
> >
> >
> > SET default_transaction_read_only to off;
> > BEGIN;
> > SELECT * FROM gm.access_log WHERE pk = 67314;
> > DELETE FROM gm.access_log WHERE pk_audit = 593079;
> > REINDEX TABLE gm.access_log;
> > ROLLBACK;
> >
> > Karsten
> > --
> > GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B
>



reply via email to

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