Re: Only getting few records inserted from millions - Mailing list pgsql-general

From Erik Wienhold
Subject Re: Only getting few records inserted from millions
Date
Msg-id 1775058340.130266.1694108347636@office.mailbox.org
Whole thread Raw
In response to Only getting few records inserted from millions  (Anthony Apollis <anthony.apollis@gmail.com>)
List pgsql-general
On 07/09/2023 19:14 CEST Anthony Apollis <anthony.apollis@gmail.com> wrote:

> The problem is that I am only getting 19 rows inserted into my destination
> table. My source has over 5 million rows. What am I doing wrong?

Few ideas:

* Column dim."IMETA_Entity_Mapping"."Entity_Secondary_Key" allows NULL but the
  join condition in your SELECT does not account for that.  That may be the
  reason you get less rows than expected.  The columns of the other join
  conditions are all NOT NULL as far as I can tell.

* Index corruption is also one possibility.

* Are there BEFORE triggers on the destination table that may prevent the INSERT
  of most rows (assuming that the SELECT returns the expected rows)?

--
Erik



pgsql-general by date:

Previous
From: Sai Teja
Date:
Subject: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL
Next
From: Tom Lane
Date:
Subject: Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL