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 1pLZy5-00017N-UU for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Jan 2023 01:25:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pLZy3-0008I9-NV for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Jan 2023 01:25:19 +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 1pLZy2-0008Hz-2H for pgsql-hackers@lists.postgresql.org; Sat, 28 Jan 2023 01:25:19 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pLZxy-0004Jv-Q8 for pgsql-hackers@postgresql.org; Sat, 28 Jan 2023 01:25:16 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 1F47C3200974; Fri, 27 Jan 2023 20:25:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 27 Jan 2023 20:25:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1674869111; x=1674955511; bh=/XrGIUfXrz BprY7mewayP/TpWCY0E8DxVOJZdhC8Al0=; b=d9gmudV/MdNcJX5VCF3CMCHnqn kupPwBK3ZSd5Kknh0OQewe28YHUwdL+UZ5nM8G1an5inai7gVuNQ0kY7D+MeYY// Th3t2lqKbbQcXF1PbmeYcDxlwGasbvxnzdpszd2UuvdeoF6R7cnDrAuPuzVoUDgS VKQT/UNDQOhh+rNH8KihdTiwQZvWqUgrqUJvA3V/4/FP/cRQKNV704g1RiU0GRZl tpB+hEJ99uW83YoB7kpSxbyEswSlKjukXl+XVBmrfRfJpWk1DRzdSp4EjO4SpgRQ VWnnDCt1szQ+nmYKbP6DnxDYOmuzyqHpsCpmqW1xTC3ZZ/N0642l/343HhUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674869111; x=1674955511; bh=/XrGIUfXrzBprY7mewayP/TpWCY0 E8DxVOJZdhC8Al0=; b=ZJuf2seqTHNhGHxoAHjWMSKDbWGEYbtLIA5LdkTm9nND 7NF3etJVwPgmkOCnBX7DmSAQDLRm7QlfCxdRsP+X/61iUXHAajIGoNOGrE/6z6RO Wvpqb7FtywBewdALZIs8P+Z3vifEbyTRrrZYob+pPFOBnAc+UXGD5FIXmSyZVfKD YKwFsEQNKtHiMnpCRC1yfX4sDRxKMAyPfPiLfQHz0CerXoHHtvW10tORM7LjkTOv IZ5HcP63prQcUG20nXsNAFCYJuq4GIMDq1vfpu3H/QID17MrpxWPGKV3S5JfOMTt vknH9jKswCfFq0NX+KSp04Hugs2UEkfbB0ux7WZJOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvjedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Jan 2023 20:25:11 -0500 (EST) Date: Fri, 27 Jan 2023 17:25:09 -0800 From: Andres Freund To: Melanie Plageman , Tom Lane Cc: Pg Hackers Subject: Re: Small omission in type_sanity.sql Message-ID: <20230128012509.5iwjktq4vu4kblef@awork3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-01-18 14:51:32 -0500, Melanie Plageman wrote: > I only changed these few lines in type_sanity to be more correct; I > didn't change anything else in regress to actually exercise them (e.g. > ensuring a partitioned table is around when running type_sanity). It > might be worth moving type_sanity down in the parallel schedule? Unfortunately it's not entirely trivial to do that. Despite the comment at the top of type_sanity.sql: -- None of the SELECTs here should ever find any matching entries, -- so the expected output is easy to maintain ;-). there are actually a few queries in there that are expected to return objects. And would return more at the end of the tests. That doesn't seem great. Tom, is there a reason we run the various sanity tests early-ish in the schedule? It does seem to reduce their effectiveness a bit... Problems: - shell types show up in a bunch of queries, e.g. "Look for illegal values in pg_type fields." due to NOT t1.typisdefined - the omission of various relkinds noted by Melanie shows in "Look for illegal values in pg_class fields" - pg_attribute query doesn't know about dropped columns - "Cross-check against pg_type entry" is far too strict about legal combinations of typstorage > It does seem a bit hard to remember to update these tests in > type_sanity.sql when adding some new value for a pg_class field. I > wonder if there is a better way of testing this. As evidenced by the above list of failures, moving the test to the end of the regression tests would help, if we can get there. > --- All tables and indexes should have an access method. > -SELECT c1.oid, c1.relname > -FROM pg_class as c1 > -WHERE c1.relkind NOT IN ('S', 'v', 'f', 'c') and > - c1.relam = 0; > - oid | relname > ------+--------- > +-- All tables and indexes except partitioned tables should have an access > +-- method. > +SELECT oid, relname, relkind, relam > +FROM pg_class > +WHERE relkind NOT IN ('S', 'v', 'f', 'c', 'p') and > + relam = 0; > + oid | relname | relkind | relam > +-----+---------+---------+------- > (0 rows) Don't think that one is right, a partitioned table doesn't have an AM. > --- Conversely, sequences, views, types shouldn't have them > -SELECT c1.oid, c1.relname > -FROM pg_class as c1 > -WHERE c1.relkind IN ('S', 'v', 'f', 'c') and > - c1.relam != 0; > - oid | relname > ------+--------- > +-- Conversely, sequences, views, types, and partitioned tables shouldn't have > +-- them > +SELECT oid, relname, relkind, relam > +FROM pg_class > +WHERE relkind IN ('S', 'v', 'f', 'c', 'p') and > + relam != 0; > + oid | relname | relkind | relam > +-----+---------+---------+------- > (0 rows) Particularly because you include them again here :) Greetings, Andres Freund