Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTr6o-0006ZJ-PR for pgsql-novice@arkaria.postgresql.org; Mon, 14 Mar 2022 20:16:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTr5p-0004Et-Be for pgsql-novice@arkaria.postgresql.org; Mon, 14 Mar 2022 20:15:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTr5p-0004EW-1X for pgsql-novice@lists.postgresql.org; Mon, 14 Mar 2022 20:15:01 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nTr5m-00050K-Hq for pgsql-novice@lists.postgresql.org; Mon, 14 Mar 2022 20:15:00 +0000 Received: by mail-ej1-x631.google.com with SMTP id hw13so35195542ejc.9 for ; Mon, 14 Mar 2022 13:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:to:content-language:from :subject; bh=LLNxX7s+ZcJOaehes7Iz9sc266k0GfjXCOWSU5tMIIU=; b=hVzHlJR3uF/7oKb91huBCk/KZDFa9wY6jtwNUK1Yf2lpiYze3uRDx65vViLO52wiPn rwI2bla4sbqQtAf3Mx60TLoUBPm4Hen7NWktDbBkg9og8W33tT9IFZ2TSUDkR/NTAP8e aFX+GAdXYyvSaEQU17JvKSMytGO52J+9tuo6dbDKNMFKPhHkX6Ic7egD0WdFEZWdRBfN K0JTSVZ0AA2zc8PGIeivH4v2w5D+1+Jq5BCdL0VeX+oTnD3J41fwiTmyR7EGatPmEYvG 2cQ58mdxtDimqMsi6RtdcTOkuO5kDLNreMZ+VaL0fOLDstrbMwITfZtbRceqGozeSr8C U59g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:to :content-language:from:subject; bh=LLNxX7s+ZcJOaehes7Iz9sc266k0GfjXCOWSU5tMIIU=; b=wTQ8qgtbahFh+E7GQJ2KLIPk0b3yyMSXyKWT2eKXFNhN4/d4bhoHNYgi1ZcdrdeiTE R4iQKWOgVloYNGKijjo+2wl/PrAz32u0VY7zR0CMVKwVIE/ikA1wZ9mGWZN4kEf1fSQy GWQaNZAYb/ZaqUt1lnJdW64+i7ntcoi1/Yp7Hkhkb2Pr0jCLeSxrDvtkZaIACTUMp77p jnHi2loXIYCFOm5A+WlJc70vYUG873wFItzzUyG/bfGF4KDJ6zEX3OTqvNy+Tf/RCho5 401rRfK+YgR8g62aNNHLnUMfZMXkVh6kl3FgX5XTco3J17jBI+PUTTuN+pK7MYCpkvmn ZPpA== X-Gm-Message-State: AOAM530rZab5dKURtjWnCJOXavYeKprEL3uUZfd1tyljtpZ7u926UoUn EoN4Nn+iXXf9zfomyhVGxsYBIiCXvItfaw== X-Google-Smtp-Source: ABdhPJytSYRUWcdRQrPs5Hvoaa/lviQ962qg1CGPvg3b49ZNtc2Z+p3iIpphPVSk+Os+PBaJQgeY6Q== X-Received: by 2002:a17:906:2811:b0:6ce:eacf:5210 with SMTP id r17-20020a170906281100b006ceeacf5210mr20658544ejc.618.1647288897271; Mon, 14 Mar 2022 13:14:57 -0700 (PDT) Received: from [192.168.1.131] (94-39-222-46.adsl-ull.clienti.tiscali.it. [94.39.222.46]) by smtp.gmail.com with ESMTPSA id p3-20020a1709060e8300b006d0e8ada804sm7170412ejf.127.2022.03.14.13.14.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Mar 2022 13:14:57 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------Sc0S0KqfpneeslMjeqzSkJ4H" Message-ID: <9bde7204-1b4c-8702-4593-5afd0607c5d2@gmail.com> Date: Mon, 14 Mar 2022 21:14:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 To: pgsql-novice@lists.postgresql.org Content-Language: en-US From: flik Subject: Fixing Integrity check errors List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------Sc0S0KqfpneeslMjeqzSkJ4H Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi! What would be the best way to solve integrity errors (unique constraints) caused by a badly done dump/restore? My best guess as ignorant ass, it's simply to dump the current data (only), start a new project, apply the migrations and loading back data. Given that the schema is exactly the same, would this work? If so, how can I do it with postgres? I already tried to pg_dump --data-only but I keep getting weird errors. Sorry if my message is confusing-confused, I'm quite new with databases! --------------Sc0S0KqfpneeslMjeqzSkJ4H Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi!

What would be the best way to solve integrity errors (unique constraints) caused by a badly done dump/restore? My best guess as ignorant ass, it's simply to dump the current data (only), start a new project, apply the migrations and loading back data.
Given that the schema is exactly the same, would this work? If so, how can I do it with postgres?
I already tried to pg_dump --data-only but I keep getting weird errors.

Sorry if my message is confusing-confused, I'm quite new with databases!

--------------Sc0S0KqfpneeslMjeqzSkJ4H--