Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rMwre-007vFF-VE for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2024 21:08:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rMwrd-007j9l-Ng for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2024 21:08:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rMwrd-007j9c-D5 for pgsql-hackers@lists.postgresql.org; Mon, 08 Jan 2024 21:08:53 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rMwra-000Xho-BE for pgsql-hackers@postgresql.org; Mon, 08 Jan 2024 21:08:51 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-3606dc50447so14218135ab.2 for ; Mon, 08 Jan 2024 13:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704748129; x=1705352929; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=yT365XF16qks8Onsj54Try02ONl2sR7jYwvGFkaPl0A=; b=YCaznGe0vKdoPhIxLAreextukKgsBMR2a3QLFDlSpeu/o2zIvNglGzlYTEWSrr7HG5 yFJOiCTLxGvqOF5JO2/dchaTL6VfyzmeFKat4p3eK0MorUKLFKUulqQbdcXIFuAH7VQD gcyXnaGwDJu3PH+dYHlkKMcYxScyWskA43e/fp9DKEdGC402OFTkyWnzqrRFUaaVwvmR Nu8vD99AUDdVgsRESvXd4enPidjc7S5BVuOS7kFzsZH4EwzQ2sGwTTCAEWLP5LSUMXL9 zslFe1AB7sd3VqKBMvA7cJ4hIqeS3K/bgtpYB945sDGaoVGRxJS/uZkR5TNYa3/8BEqA Pc9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704748129; x=1705352929; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yT365XF16qks8Onsj54Try02ONl2sR7jYwvGFkaPl0A=; b=b02c4Zt087IMMA6aakqrwz6oGowSWrKSAShTfr8EpFA4W1ckEdQhzpZ7eY3HLRrvQg +oF5X81PUCr0aMhe7G5ZWW2hAzpJs99pQJLyNmK2CJfLgQyvIYIZi4nyPyRleeDRtrl2 FoWeEWwFhIoVQtgm4sU5lifK+olwA7Zf4P2u3Tq41mYRZau2/Pne7+9lrBnTZh9x3XFe MxBWCLKllvE7UIADZrZ1wBNtJcSZIsdYaZOOj4o5resvDIx3dZmDvmFuwCdSORVRXWtj ewU7qxvdfLHcGJegwY1KjqpuOZfaBT6pBchyUkv9P1gFcNl0SNfWtiKG7DEdoF+HOdAh KCtg== X-Gm-Message-State: AOJu0Yw3wEbYmnypBelSidakwrKzD7aIGIHaH9Y9hW9dHhKZSA/T5Iti laLXzgGO6/9s5cWmWJbyMys= X-Google-Smtp-Source: AGHT+IEAMZ1iCxQZW4Sp60fMFAfXckkePYBvf4PPuexqutUBeJMcz1edGGBixgiHIuR49WxVkGsjZQ== X-Received: by 2002:a05:6e02:b25:b0:35f:d9e4:9c7c with SMTP id e5-20020a056e020b2500b0035fd9e49c7cmr6938400ilu.62.1704748129585; Mon, 08 Jan 2024 13:08:49 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id bb7-20020a056e02000700b0035f7ea78576sm175863ilb.24.2024.01.08.13.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 13:08:49 -0800 (PST) Date: Mon, 8 Jan 2024 15:08:47 -0600 From: Nathan Bossart To: Dagfinn Ilmari =?iso-8859-1?Q?Manns=E5ker?= Cc: vignesh C , Tom Lane , Peter Eisentraut , pgsql-hackers@postgresql.org Subject: Re: Adding a pg_get_owned_sequence function? Message-ID: <20240108210847.GA2796792@nathanxps13> References: <87jzwcsasv.fsf@wibble.ilmari.org> <4970adf1-cdb0-9ae5-d405-e9c3395d9931@eisentraut.org> <2797313.1694529622@sss.pgh.pa.us> <87v8cfo32v.fsf@wibble.ilmari.org> <20231024162929.GA871220@nathanxps13> <87a5pfn4o5.fsf@wibble.ilmari.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87a5pfn4o5.fsf@wibble.ilmari.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 08, 2024 at 04:58:02PM +0000, Dagfinn Ilmari Mannsåker wrote: > We can't make pg_get_serial_sequence(text, text) not work on identity > columns any more, that would break existing users, and making the new > function not work on serial columns would make it harder for people to > migrate to it. If you're suggesting adding two new functions, > pg_get_identity_sequence(regclass, name) and > pg_get_serial_sequence(regclass, name)¹, which only work on the type of > column corresponding to the name, I don't think that's great for > usability or migratability either. I think these are reasonable concerns, but with this patch, we now have the following functions: pg_get_identity_sequence(table regclass, column name) -> regclass pg_get_serial_sequence(table text, column text) -> text If we only look at the names, it sure sounds like the first one only works for identity columns, and the second only works for serial columns. But both work for identity _and_ serial. The real differences between the two are the parameter and return types. Granted, this is described in the documentation updates, but IMHO this is a kind-of bizarre state to end up in. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com