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 1sJQSc-004oFe-1y for pgsql-interfaces@arkaria.postgresql.org; Tue, 18 Jun 2024 04:28:46 +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 1sJQSZ-007J5I-Bg for pgsql-interfaces@arkaria.postgresql.org; Tue, 18 Jun 2024 04:28:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJQSY-007J57-Vr for pgsql-interfaces@lists.postgresql.org; Tue, 18 Jun 2024 04:28:44 +0000 Received: from mail-bn8nam11on2125.outbound.protection.outlook.com ([40.107.236.125] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJQSW-002E47-Et for pgsql-interfaces@lists.postgresql.org; Tue, 18 Jun 2024 04:28:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b0uJkvL4vA9KeU5TIWV/XUDCQqL0l2KiOSkN6PsSsYwgmSSCYVMx7W6Yhfq2InVLIcf8UUO5PUfAnIr1YU0Dr8Etn5W0YxDahAteV6U8TshsoTrbjbHhFfBWSRj2FhBOJ+WFosGPSiIZjmc4Epr8WRAlshDmFdEP8v4sz0N/tJuiqJWMaNdrg9M0oilSyGs878p5DzKmir9xaa0neUyur7oyWJR3LrMNJF2I5DNwymBln5O0YCUxQEPLeBTA36FHkKsDv7bP/L1P306krDHmsV7Fxc806SV5DwlrO5ss5TgM0mxNOY7sGeTOom4UshkHZR0dntvrM1jsZyByQVhifg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bkSbJ6Je3T5wq8KXHYSefb7kEVx6iEmnQQc1oiX4iOY=; b=d30fQcxI9bYNNLsb+RCMuTaw01AjDG3sA6Fv7zShDpnt8a4iX9BUqwbYJiAnzEurVHPwE/sK8T/6crOZ9ot1hKISUiqI9qujB6uoI411JemWASrN0IBmlrEJeuoVPXPQHMfPpxS+7OQypU9D7XeTHXC2RgDcwH1xagDVoXizqcJdrz4bkWTZ06WLnXs9KZSFC6H6Y8Dc6bH9JZnOwfeWGDaOg144wJnX2Kdg/ccZsg9Ksur6Gg7h1su3M/9sFjCz1dOlIpJIqbgXSr6y2QxPCXRZ3BMCssdYDhiavPGy1//1yQoQX4w0Bc+KyanmCguNoVTnCpNgXVTlcWluARBw3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=assistek.com; dmarc=pass action=none header.from=assistek.com; dkim=pass header.d=assistek.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=assistek.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bkSbJ6Je3T5wq8KXHYSefb7kEVx6iEmnQQc1oiX4iOY=; b=e3/nYbskQY2rnI2EoRtkuPKjDZ8ZB+TBnCvZW6gxNSrhzfRNQBeULdNWzBaLsYnWqQtjrHaTZo8lPF0PTAkIrV/QP8luAbHNeLvr9IIThm9i2mOIr+0ORQFAExThBmRbVVAr4d4OKHxtVL0+nWSLG0gJdaVf+8skTcnCiJkckGI= Received: from LV3PR16MB6001.namprd16.prod.outlook.com (2603:10b6:408:1b6::8) by SA1PR16MB5102.namprd16.prod.outlook.com (2603:10b6:806:335::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.29; Tue, 18 Jun 2024 04:28:35 +0000 Received: from LV3PR16MB6001.namprd16.prod.outlook.com ([fe80::50ce:c55:8baf:fa37]) by LV3PR16MB6001.namprd16.prod.outlook.com ([fe80::50ce:c55:8baf:fa37%5]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 04:28:34 +0000 From: Maxwell Dreytser To: Tom Lane CC: "pgsql-interfaces@lists.postgresql.org" Subject: Re: RowDescription for a function does not include table OID Thread-Topic: RowDescription for a function does not include table OID Thread-Index: AQHawSk4Ss901jpQLkiyAb/qTIeG1LHM4zoAgAAAzMs= Date: Tue, 18 Jun 2024 04:28:34 +0000 Message-ID: References: <3528232.1718682678@sss.pgh.pa.us> In-Reply-To: <3528232.1718682678@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=assistek.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV3PR16MB6001:EE_|SA1PR16MB5102:EE_ x-ms-office365-filtering-correlation-id: f5f6294b-bcf8-4e56-b6f0-08dc8f4f1df5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230037|366013|376011|1800799021|38070700015; x-microsoft-antispam-message-info: =?iso-8859-1?Q?fy8ZIKNnJlS22LDxm2bDz1X58k8Wu+TFBzF3nqt9rIcx3UiKjbP1xmECPx?= =?iso-8859-1?Q?nuFlOuscXO1QYfPYX3Cs0TW7SzJNpU61zLUEinoPPnwsLjZY3c1jXpZoJg?= =?iso-8859-1?Q?CEaKfK0jHcKCRaqOzw+C+TXkpySaj6a4t1rMDphnjY8MK+GSUZRAKznUE9?= =?iso-8859-1?Q?tKWMb83A0moOlovq8L/ZPCKeA8R0/gZFIvZfU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zlZoFjveI5F8Oudm1c7lgmf2TvrDxQdIeu/SZZYFieC/ci?= =?iso-8859-1?Q?mxGhtY+/PCEa1V0Q4LcEgwk4Upp46p2uyQn4p+vDo2KFCzlMawQFLsY6mW?= =?iso-8859-1?Q?7fHbnJON20MzqERJMPj0jILj2Z9eQLi3RQVP+DQRFG9OIMd0kZFvthHGoK?= =?iso-8859-1?Q?ZPU2QDPCpOFDO8o4ODYSBCBsJn4m60UWUCtL7ohhGRsuofvBbPEamObR5t?= =?iso-8859-1?Q?cycUEJq/TxcYKs42EnHmXwl52rNPGQvIMKJplTxTy1Ds6aIK9MPM5nrDJ6?= =?iso-8859-1?Q?/u52UFkefd44TkyV99bjSWRxDM6qByre6DPBLL9KnN2yA0HsjFuF8=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV3PR16MB6001.namprd16.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(366013)(376011)(1800799021)(38070700015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?kCJRmaD30Iohn6jjLYJbEuks1U/vH13Bxq5R4Q4HpSTq2a8HNS5mozoI+h?= =?iso-8859-1?Q?HqTY0M34pVu+mMgFxHqxo9EOteQOv6WcJAgFPg0zvPxCzhNS3vPlvrEmsL?= =?iso-8859-1?Q?BYbQcIkgu6kxcuX53QRq6mo2gegvFfLN8D41I4pG9kQ/rjPzcaHu89v1Qk?= =?iso-8859-1?Q?rpfyS5DZELReR/t6LcMionljTPTt6DsrwqtPbu0PWGhptMVPxmD/cXPgUk?= =?iso-8859-1?Q?az5SdoCAJy115i4lML4i4XkRweAZ68GMbLnJp0R4QR7Yz/uv1ZdJLrKDmt?= =?iso-8859-1?Q?VDMXq5TBAqr0qdRO5A1dEmRajyUIw/gshe3DwIGjWBfUeetKM7FpictKEK?= =?iso-8859-1?Q?We4oA/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z/lDpNPKGojf?= =?iso-8859-1?Q?6Bwd8fncFDC36PXmeyWmKOGhrMEpRtrO24y9icDFmk3MQjCM9Bh87j3iYN?= =?iso-8859-1?Q?nH1mSnogboFKlPV33zJhTldjPd7hLEJaKCDMPoCDLBnJ8sPtemqFgdvUNQ?= =?iso-8859-1?Q?UsvMVvya1Z3po1V+vSfOWkLfDf7NuyuqNpWqZBCX3vPd92X8d2CpFvzItc?= =?iso-8859-1?Q?af99Intp5ZDrtkTdFpaJm8hnUsJ9kjPG8C5k4VoIGDagV7yLOEM0NM9lmk?= =?iso-8859-1?Q?YZHFZV4yqRJPNvuzMSLKZZoo/hzEbys8BFg33fOdlNRhUXavHnoqrrbRZR?= =?iso-8859-1?Q?EdiTc0RarpxrfJYmxjSD7Zzat3ubNgKNBzI+ebHwFXz+XYb2RLTzQUEZSH?= =?iso-8859-1?Q?jSNUBUg7uVBUpkaEwFIDV/SuF4Lvl9HHTp5K0l/cs+dEp9lOpM8V2qPg?= =?iso-8859-1?Q?=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: assistek.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV3PR16MB6001.namprd16.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5f6294b-bcf8-4e56-b6f0-08dc8f4f1df5 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jun 2024 04:28:34.6976 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6163a167-3399-4bf6-885f-4fce6e26edf0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: w+9izp90vUYvzplB49sQ+SnWmRBcP/oRqc5lQBwc9NIKuEPutvVc+l9Wmx82IUyZkogGExxQutv9aO56W05xX/+i6wDuWhzBNvluRJAGB7M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR16MB5102 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk From:=A0Tom Lane :=0A= =0A= >Hmm, I do not think that syntax means what you think it means ;-).=0A= =0A= Its an interesting trick that I came across on DBA SE on a question named "= How to use RETURNS TABLE with an existing table in PostgreSQL?".=0A= =0A= >However, it seems to end up with prorettype =3D=0A= >physical_table'::regtype anyway thanks to some special rules about=0A= >single-column output tables, so as far as I can see you should get=0A= >the table's composite type OID as the column type OID in the result=0A= >descriptor for "SELECT my_function(...)".=A0 Or is that not the case=0A= >you're concerned about?=0A= =0A= The query I am running is "SELECT * FROM my_function()". According to Wires= hark I can see that the returned RowDescription shows 0 for Table OID and C= olumn index:=0A= =0A= PostgreSQL=0A= Type: Row description=0A= Length: 219=0A= Field count: 7=0A= Column name: table_id=0A= Table OID: 0=0A= Column index: 0=0A= Type OID: 20=0A= Column length: 8=0A= Type modifier: -1=0A= Format: Binary (1)=0A= =0A= =0A= >I'm confused about exactly what you're asking for, but (a) returning a=0A= >type OID where a relation OID is expected is absolutely not OK ---=0A= >there is no guarantee that those OID sets are distinct; (b) regardless=0A= >of that, you seem to be asking for a silent semantic change in the=0A= >wire protocol, which is going to be a very hard sell because it will=0A= >probably break more applications than it makes happy.=A0 Why can't you=0A= >get what you need from the composite type OID?=0A= =0A= I would indeed like the relation OID to be returned for the composite type = that is returned from the function. Maybe this can be simply considered a b= ug as it does seem like returning the relation OID that is clearly availabl= e would be the expected behaviour.=0A= =0A= Regards,=0A= Maxwell.=