Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gP8qD-0008MG-05 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Nov 2018 16:25:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gP8qB-0004SR-IR for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Nov 2018 16:25:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gP8qB-0004SH-B3 for pgsql-hackers@lists.postgresql.org; Tue, 20 Nov 2018 16:25:31 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gP8q4-0006dj-AR for pgsql-hackers@postgresql.org; Tue, 20 Nov 2018 16:25:30 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 4DF7E5F79C; Tue, 20 Nov 2018 11:25:22 -0500 (EST) Date: Tue, 20 Nov 2018 11:25:22 -0500 From: Stephen Frost To: Robert Haas Cc: Tom Lane , Andres Freund , "pgsql-hackers@postgresql.org" Subject: Re: [RFC] Removing "magic" oids Message-ID: <20181120162521.GD3415@tamriel.snowman.net> References: <20180930034810.ywp2c7awz7opzcfr@alap3.anarazel.de> <20181014220923.j4mlgue7y7chv533@alap3.anarazel.de> <943.1539556490@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="G/vVCphCGw+yuveY" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --G/vVCphCGw+yuveY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Robert Haas (robertmhaas@gmail.com) wrote: > On Sun, Oct 14, 2018 at 6:35 PM Tom Lane wrote: > > Andres Freund writes: > > > Does anybody have engineering / architecture level comments about this > > > proposal? > > > > FWIW, I'm -1 on making OIDs be not-magic for SELECT purposes. Yeah, it= 's > > a wart we wouldn't have if we designed the system today, but the wart is > > thirty years old. I think changing that will break so many catalog > > queries that we'll have the villagers on the doorstep. Most of the oth= er > > things you're suggesting here could be done easily without making that > > change. > > > > Possibly we could make them not-magic from the storage standpoint (ie > > they're regular columns) but have a pg_attribute flag that says not > > to include them in "SELECT *" expansion. >=20 > I think such a flag would be a good idea; it seems to have other uses. > As Andres also noted, Kevin was quite interested in having a > hidden-by-default COUNT column to assist with materialized view > maintenance, and presumably this could also be used for that purpose. Yeah, I like the idea of having this column too, it'd also be useful for people who are trying to use column-level privileges. > I am less sure that it's a good idea that it's a good idea to set that > flag for the OID columns in system catalogs. I do think that some > tool authors are likely to have to do some significant work to update > their tools, but a lot of tools are probably already querying for > specific columns, not using *, so they'll be fine. And like Andres > says, it seems like we'll be happier in the long term if we get way > from having OID columns be invisible in system catalogs. That's just > confusing. Tools should *really* be using explicit column names and not just 'SELECT *' (and my experience is that most of them are using explicit column names in their queries- sometimes to explicitly pull out the oid column since it's so frequently needed...). I suppose if we wanted to get fancy we could allow users to adjust the setting on catalog tables themselves... I'd certainly be happier with the OID columns being visible by SELECT * against the catalog tables though. By my reckoning, we'll break a lot fewer tools/queries with this change than the changes we made for xlog -> wal and location -> lsn in various tables and functions with v10. Thanks! Stephen --G/vVCphCGw+yuveY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJb9DVxAAoJEO1sijiDR2RVnZoP/ir1cIHSOyt/I6CcVO8L//an eCr5liJdT3QIhmPexRHhDJv1sb9xIJT2l7JtbjEBDQ64dljmNppeHkxAWJg2EgAQ XNRp+lQtNKbpDZOrOUgUwLdqEJCGwajB7kqBT0fq/FnosIr+EXTt2RiEZgvVzeQ2 HzscnwiJgY+pwWNSlI8MgeI5nt7rihDw/vgnM8Hv2r9s6qvuKAjwWXKvn7lFuWOj vChI0An10mqwjVDEWvcLekBWez5AVOOtQCMpGR2UWqiOiIEFCx8v9zuS28NGG+Ig /lsfKr7NhGCryKrddXJTHJ2wtZlWAifrjjzA9J68dgh5tD8pzAF4HX+tN8mpogna G9WAsBoIshC6MZZ+pdP/uROhWJGhe5Z4QRG63GpEFstaEhBQICnzNQM+0STxjcZT HVkKwbjVzwSuBBiIXEoiLgtP2XPk/d4cK3nOexGRyPvVaUIrT2YkHoN08R9MMpsJ UFjkKs+Z7JQ6wyGA33r8j67sv9wgkWwqFdCYS5JepYjjSh+zVNm8tWZcsg+oCU1d fnAJCMpq+aAn1XB6tTZ+Q2/BH2FS7ynqyRsE++y/EvjfzqW44yy8PK/IoxsZupux kEkN1DJ9qmQg+UPOrgb9XhPFPxmOEYeLr95+HpSMNeLiqW0mZU1S0EgSnk6eSOTi Ona+AnG4OQYB1PutEd0I =C3lY -----END PGP SIGNATURE----- --G/vVCphCGw+yuveY--