public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: How does this FK constraint error happen?
Date: Mon, 15 Jul 2024 13:14:01 -0400
Message-ID: <CANzqJaAhhA01b-m6tufZ_AcdmbqSt7hZYQXmemspwy+=YbtJUg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CANzqJaBF6mnUy1ZfBbySzSr1AfErnrMEGJaUvdSA1H9ZXkTbEw@mail.gmail.com>
	<[email protected]>
	<CANzqJaCZkwRon9xDOeFaTd05KZM--Eei1SAiattJXurx_8n0bQ@mail.gmail.com>
	<[email protected]>
	<CANzqJaC0EYvpD-452JVS4UNH8D0qFaXygBR5je=_zK2pDziM5w@mail.gmail.com>
	<[email protected]>
	<CANzqJaCyPpUReKCy7G8mVczApoKq73-zfzbSOvpgpCGJ86igVg@mail.gmail.com>
	<[email protected]>

On Mon, Jul 15, 2024 at 12:47 PM Adrian Klaver <[email protected]>
wrote:

> On 7/15/24 09:21, Ron Johnson wrote:
> > On Mon, Jul 15, 2024 at 11:37 AM Adrian Klaver
> > <[email protected] <mailto:[email protected]>> wrote:
> >
>
>
> >     I don't think it is entirely coincidental that 1210 is the only shown
> >     user_id with a modified_on value that is in proximity to the delete
> >     error.
> >
> >
> > I don't think so either.
> >
> >     My suspicion is that actions are not happening in the exact order
> >     you think they are.
> >
> >
> > modified_on is CURRENT_TIMESTAMP or NOW() or somesuch.  I'm not sure,
> > because I'm not privy to the code.
> >
> > But I'm printing the system time in bash before every statement.
>
> That is why I wrote 'Time travel?'.
>
> I suspect the modified_on time in the table is not accurately
> representing when the row is modified.
>

That JBDC code is pretty slow...


>
> >
> >     I would think that combining DELETE FROM
> >     rel_group_user; and DELETE FROM public.access_user; in a single
> >     transaction would be a good start to fixing this.
> >
> >
> > That is in fact what I'm working on now.  There are 26 tables, and they
> > must be done in a specific order when deleting, and the reverse while
> > inserting.
> >
> > postgres_fdw would make this easier...
>
> It can't be installed?
>

Less bureaucratic overhead to write a script.


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: How does this FK constraint error happen?
  In-Reply-To: <CANzqJaAhhA01b-m6tufZ_AcdmbqSt7hZYQXmemspwy+=YbtJUg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox