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 1l1oXR-0006V5-DQ for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jan 2021 10:47:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1oXO-0007qk-Ul for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jan 2021 10:47:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1oXO-0007qc-OA for pgsql-hackers@lists.postgresql.org; Tue, 19 Jan 2021 10:47:02 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l1oXL-0000u9-BV for pgsql-hackers@postgresql.org; Tue, 19 Jan 2021 10:47:01 +0000 Received: by mail-ed1-x52d.google.com with SMTP id c6so13797578ede.0 for ; Tue, 19 Jan 2021 02:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=UkR2C6U+d350MaMTPVAZwm3opjl3/RjnLaJl9Aov2dg=; b=1qk1HmU5tGZ6oxfFqi0YSTDGjU9IDvbcRx+TPctgwyKkWSbw5RU0tCSs65EXR+ZDll NoSFy8zo5uYQ0ofhDrbGBdtq9HgvrlfWhQLsIVGyeHWON64gSqAfKAZAp8iTVG8dQbo7 KRAOMdOk2uF1mnn9s976W2EInzllRztpq1IJFrSdxhJZoIKxuA6YMlCk15mKFSPjb1gU RuVEgG0HsYyqmBoBREMkrpDEuXEVLk92n2/zm6qFIPogSPr7dMPHpPmborf1XqD1Jjvb bSsM6mcozdW0erkIoDzN8g7Z0WEbFjmxqh94W3T0s0uC+wr6eGhP2QSV+qIvcbFyEeUX Qanw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=UkR2C6U+d350MaMTPVAZwm3opjl3/RjnLaJl9Aov2dg=; b=beiYyVe7Y2fpCIga8p7P5RWjjW6fLsazCMUfrzY2QTOmeBVDA7uyhSuGBHEzWzGFgm FqbYazW6k1u/f5IDBcMKP72mxki0owICVGWS48h0w2KLoU4OIV4Jng6fpG2q25eQsM0g 4aOdSw0+7BGRr/Jq/JzRxxwBzUoOOZ444SHuPofZ/SbXiDBx3+m3h/2f08Rl5gn1g88i Vc3Im5nuOtutbxeo0mMmM/X7ZgmFjpmDkhPCU2f2xuhpLxrbotPdW+H4HvxuN2tenjeU 08CHhPOwJV3NAidUahOtncg0Ou8XMRBbV99WkpQgRpe2baTp0oxQRQlyefp2lGIG129z Bwug== X-Gm-Message-State: AOAM531T0S43FoVo2B2LDxJNNSTWnbqNAbdO+aWf5QGtLT8l1ANKOYZl 1B5ZHddfcMUCxuv8qxjzAXxK+g== X-Google-Smtp-Source: ABdhPJy5HtgYRMpZUw4qbG8f0rdpE6Li3usadUapV4KAbxFM+76OeIUlCMoWDBYEbmSl4y5OS1TCdg== X-Received: by 2002:a05:6402:b88:: with SMTP id cf8mr3054878edb.140.1611053216651; Tue, 19 Jan 2021 02:46:56 -0800 (PST) Received: from localhost.localdomain (62-46-248-242.adsl.highway.telekom.at. [62.46.248.242]) by smtp.gmail.com with ESMTPSA id t16sm10478038eje.109.2021.01.19.02.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 02:46:56 -0800 (PST) Message-ID: Subject: Re: Add primary keys to system catalogs From: Laurenz Albe To: Tom Lane , Peter Eisentraut Cc: pgsql-hackers Date: Tue, 19 Jan 2021 11:46:55 +0100 In-Reply-To: <266949.1610921277@sss.pgh.pa.us> References: <348f3158-bf7e-c5f0-f33b-9e552e3d5481@2ndquadrant.com> <266949.1610921277@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, 2021-01-17 at 17:07 -0500, Tom Lane wrote: > Peter Eisentraut writes: > > [ v2-0001-Add-primary-keys-and-unique-constraints-to-system.patch ] > > [...] do we really want to prefer > using the OID indexes as the primary keys? In most cases there's some > other index that seems to me to be what a user would think of as the > pkey, for example pg_class_relname_nsp_index for pg_class or > pg_proc_proname_args_nsp_index for pg_proc. Preferring OID where it > exists is a nice simple rule, which has some attractiveness, but the > OID indexes seem to me like a lookup aid rather than the "real" object > identity. I disagree. The OID is the real, immutable identity of an object. The "relname" of a "pg_class" encatalogtry can change any time. Since there are no foreign keys that reference catalogs, that won't cause problems, but I still think that primary keys should change as little as possible. Yours, Laurenz Albe