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 1nco1q-0007Tx-Ug for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 12:47:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nco1p-0003WW-LD for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 12:47:53 +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 1nco1p-0003Vx-6o for pgsql-general@lists.postgresql.org; Fri, 08 Apr 2022 12:47:53 +0000 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nco1m-0006bx-Bk for pgsql-general@lists.postgresql.org; Fri, 08 Apr 2022 12:47:52 +0000 Received: by mail-qt1-x834.google.com with SMTP id t7so10445540qta.10 for ; Fri, 08 Apr 2022 05:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wi3ck-info.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=YKbAOTaIMuTByQO0Yy4c2wZH+Z/Gp1VK9XmLQhGQ4zs=; b=A92rozDxoS9zx2IjgT/7y6jFnvVBh/T41SvKlS7UZfwi3di+JY6dvlgSrohFuKDA0c Ux7HMqxTYTU0SeOElmgM0xYDZK+0aWoca+KnCCxt6BdD0HKCODa7hrsscbNAB17AYjUo NJjD5aDAsM8CWQ8EGY+m7lqMdD1ROoM9wv5L+nebhfZi6+OmVYwMlcAqebJ9fTn56aEg 92pSi1cAli5gpuamPGzGOyAJe9OTOW4qAVU5HzBolWzPKD5a1nw5xMtPe5FdMn17P1Oz CBa3wp4TALhamIybWMFPb5/dGS1fU8GCG4Nyk6KaeBCxHEBmYBkyzCZ7SIgalOpT66rc WANw== 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:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=YKbAOTaIMuTByQO0Yy4c2wZH+Z/Gp1VK9XmLQhGQ4zs=; b=oivijRbMBD2Z5IhF0i/gKyuyt2cxcPA9bc0Gnrt2b6IUoq3NsfGVOA4RIInQ2+aXd9 7YSXZLUWC0Xb++WEgIYE8eXkJMlDd9FM7yy8kOe56W7m7d9UJ2Wlbnc1o3XUS0+XrSCH wiO/DslyBlFbblOYWR00l/2or/Q41eutO1YNkYxif1bidVwbO0f1Lqn8qsDjN80sjS9G 6O18XPZ4ZhdH4xPYOFoU69n5p7cqxn7NegRFHz7FkTlWopym29+c1AFQg7sPzmHnujuJ RvEAiwxJ3VFMaBEl/4cikaYpf18G3bMl3tQX9YQA/c4TC/btbKNd4wv6Ol/b+Oi5Ift2 +SoQ== X-Gm-Message-State: AOAM533XmDz4t0RzVAFaMRyhD8jl3kkZcbaQZX1LcfIMxoSCe35Kprsw JCZWWsHTzD2EQEjta6te9njEiA== X-Google-Smtp-Source: ABdhPJzemG8+sbyfmQbS0GtjVfb/qFkS4uqYh6JTSmWBrrhC6XCqXHOMeenNQEuQ/cQQ/br1pa4P+Q== X-Received: by 2002:a05:622a:4cd:b0:2e1:ec2f:8c22 with SMTP id q13-20020a05622a04cd00b002e1ec2f8c22mr16040339qtx.494.1649422067794; Fri, 08 Apr 2022 05:47:47 -0700 (PDT) Received: from [172.21.8.10] (pool-71-244-100-177.phlapa.fios.verizon.net. [71.244.100.177]) by smtp.gmail.com with ESMTPSA id g5-20020ac87f45000000b002e125ef0ba3sm17955671qtk.82.2022.04.08.05.47.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 05:47:47 -0700 (PDT) Message-ID: <0e4ea8e7-bfe2-b3ce-1edb-baa247bac0ca@wi3ck.info> Date: Fri, 8 Apr 2022 08:47:46 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: What have I done!?!?!? :-) Content-Language: en-US To: Nikolay Samokhvalov Cc: Perry Smith , pgsql-general@lists.postgresql.org References: <70c17f9b-1e6e-5dc2-ec1b-a60f9000026c@wi3ck.info> From: Jan Wieck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/8/22 01:57, Nikolay Samokhvalov wrote: > On Thu, Apr 7, 2022 at 8:10 AM Jan Wieck > wrote: > > So **IF** Active Record is using that feature, then it can dump any > amount of garbage into your PostgreSQL database and PostgreSQL will > happily accept it with zero integrity checking. > > > It's DISABLE TRIGGER ALL > https://github.com/rails/rails/blob/831031a8cec5bfe59ef653ae2857d4fe64c5698d/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb#L12 > Similar poison, same side effect. Looking further at that code it also directly updates the PostgreSQL system catalog. This is a big, red flag. Why do the Rails developers think they need a sledgehammer like that? It seems to be doing that for over 7 years, so it is hard to tell from the commit log why they need to disable RI at all. Regards, Jan