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 1jn0Y8-0003PC-Nm for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Jun 2020 14:02:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jn0Y7-0007vf-I3 for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Jun 2020 14:02:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jn0Y5-0007vY-Qz for pgsql-hackers@lists.postgresql.org; Sun, 21 Jun 2020 14:02:19 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jn0Y1-0004Tt-4v for pgsql-hackers@lists.postgresql.org; Sun, 21 Jun 2020 14:02:17 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 20F175C0590; Sun, 21 Jun 2020 10:02:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 21 Jun 2020 10:02:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h= from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=fm2; bh=UKYz0u2ZndK1ViYlvM08dFnSdc w/60BpTnvxUuuaeXc=; b=xnRKWGiM0fhvdvpdcL6ONVKsvu0Und5EnPN4fpunKn mfA1Iy64QsNA5vq/V00NwwJudJyva3PNCJeKkp07u2l7KLHhNHldhyJnbx5aHl46 m+ZK3EKnBjjmLuYHNIZv+kussoONUYD4Vqlc/7VVk8xhzkDdugyaQS7rfo7pCYNe UyVArU+kb9fs9YFaES+nGrqR0+IJO7cJpDdmpY4nQqXlDC4W0m86Dtud30qSbElu JQg/Mksg8/WMOIQG2hOfb/Yt+G6lnCzkCnSYVfIYr2lN3n/+DWAaE/Q2MdG29A8z Clv7EGQp5VlZuavPUbUJBXb27E3YeVQAooR0/J+5PN8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=UKYz0u 2ZndK1ViYlvM08dFnSdcw/60BpTnvxUuuaeXc=; b=Z7Zroh7l1NI85B2k+xDMhC x8fakNuYEW1N2OIyMgyTl7KfPtiJK34yjj7dGJL9UOUT3Q6o0Bb0ORHstkk/sRpD VLvH7ogyMGJxZKDlVsdCbo8DsnLYrSO1dpL5xM2dxC7fTAhdFrlWKMGFYeA/DtrL ildRIuAqbLLWoj8ziO7ruOdBEoFCAozhB/zr81Dw+bsUlc9YRaVeHjd+359ZaBB0 Ps1h9yHaM3Ps13C31J19UnUngG5RzCWqTWEPIFLZQNnCXJ5TIR98gLzBRLChXN8W 9HnbWpIP3HRvtodtyVcU2ZboMWEGBt/Jolh6iYpOpnTMsKTIhwsSAf4yYfId6ttw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudektddgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtsehmtderredtreejnecuhfhrohhmpehilhhmrghr ihesihhlmhgrrhhirdhorhhgucdlffgrghhfihhnnhcukfhlmhgrrhhiucforghnnhhsno hkvghrmdenucggtffrrghtthgvrhhnpedvheefffduieegjefgueffueekjedvtdetgffg tddtvedtgeevuedthfeghfegffenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorh hgnecukfhppeegiedrgeefrdduhedrvdehvdenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehilhhmrghrihesihhlmhgrrhhirdhorhhg X-ME-Proxy: Received: from wibble.ilmari.org (wibble.ilmari.org [46.43.15.252]) by mail.messagingengine.com (Postfix) with ESMTPA id 16D963280069; Sun, 21 Jun 2020 10:02:09 -0400 (EDT) From: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) To: Fabien COELHO Cc: PostgreSQL Hackers Subject: Re: [PATCH] Missing links between system catalog documentation pages References: <87mu5xqc11.fsf@wibble.ilmari.org> <87ftawp3n4.fsf@wibble.ilmari.org> <871rmdpzjt.fsf@wibble.ilmari.org> Date: Sun, 21 Jun 2020 15:02:07 +0100 In-Reply-To: (Fabien COELHO's message of "Sun, 21 Jun 2020 09:01:12 +0200 (CEST)") Message-ID: <87v9jko6u8.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Fabien, Fabien COELHO writes: >> It's the first mention in the introductory paragraph of _each_ catalog >> table/view page, not the first mention in the entire catalogs.sgml file. >> E.g. https://www.postgresql.org/docs/current/catalog-pg-aggregate.html >> has two mentions of pg_proc one word apart: >> >> Each entry in pg_aggregate is an extension of an entry in pg_proc. The >> pg_proc entry carries the aggregate's name, … >> >> I didn't think there was much point in linkifying both in that case, and >> other similar situations. > > The point is that the user reads a sentence, attempts to jump but > sometimes can't, because the is not the first occurrence. I'd go for all > mentions of another relation should be link. Okay, I'll make them all links, except the pg_aggregate aggfnoid column, which I've changed from "pg_proc OID of the aggregate function" to just "OID of the agregate function", since pg_proc is linked immediately prior in the "references" section, and we generally don't mention the catalog table again in similar cases elsehwere. > Alse, ISTM you missed some, maybe you could consider adding them? eg > pg_database in the very first paragraph of the file, pg_attrdef in > pg_attribute description, quite a few in pg_class… Yes, I only looked at the intro paragraphs of the per-catalog pages, not the overview section nor the text after the column tables. I've gone through them all now and linked them. Updated patch attached. - ilmari -- "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Add-missing-cross-links-in-system-catalog-documen.patch From b2940b93f5ed17c0e739d6ed0c9411a44bd87428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Sun, 24 May 2020 21:48:29 +0100 Subject: [PATCH v2 1/2] Add missing cross-links in system catalog documentation This makes all mentions of other system catalogs and views in the system system catalog and view documentation pages hyperlinks, for easier navigation. Also linkify the first mention of pg_hba.conf in pg_hba_file_rules, as that's more specific and easier to spot than the link to the client authentication chapter at the bottom. --- doc/src/sgml/catalogs.sgml | 142 ++++++++++++++++++++----------------- 1 file changed, 78 insertions(+), 64 deletions(-) diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 700271fd40..051fa7d361 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -16,7 +16,8 @@ Normally, one should not change the system catalogs by hand, there are normally SQL commands to do that. (For example, CREATE DATABASE inserts a row into the - pg_database catalog — and actually + pg_database + catalog — and actually creates the database on disk.) There are some exceptions for particularly esoteric operations, but many of those have been made available as SQL commands over time, and so the need for direct manipulation @@ -381,9 +382,10 @@ sum, count, and max. Each entry in pg_aggregate is an extension of an entry - in pg_proc. The pg_proc - entry carries the aggregate's name, input and output data types, and - other information that is similar to ordinary functions. + in pg_proc. + The pg_proc entry carries the aggregate's name, + input and output data types, and other information that is similar to + ordinary functions. @@ -407,7 +409,7 @@ (references pg_proc.oid) - pg_proc OID of the aggregate function + OID of the aggregate function @@ -902,7 +904,7 @@ catalog structure for performance reasons). Also, amoplefttype and amoprighttype must match the oprleft and oprright fields of the - referenced pg_operator entry. + referenced pg_operator entry. @@ -1099,7 +1101,8 @@ table columns. There will be exactly one pg_attribute row for every column in every table in the database. (There will also be attribute entries for - indexes, and indeed all objects that have pg_class + indexes, and indeed all objects that have + pg_class entries.) @@ -1270,7 +1273,7 @@ This column has a default expression or generation expression, in which case there will be a corresponding entry in the - pg_attrdef catalog that actually defines the + pg_attrdef catalog that actually defines the expression. (Check attgenerated to determine whether this is a default or a generation expression.) @@ -1402,9 +1405,9 @@ In a dropped column's pg_attribute entry, atttypid is reset to zero, but attlen and the other fields copied from - pg_type are still valid. This arrangement is needed + pg_type are still valid. This arrangement is needed to cope with the situation where the dropped column's data type was - later dropped, and so there is no pg_type row anymore. + later dropped, and so there is no pg_type row anymore. attlen and the other fields can be used to interpret the contents of a row of the table. @@ -1835,14 +1838,16 @@ The catalog pg_class catalogs tables and most - everything else that has columns or is otherwise similar to a - table. This includes indexes (but see also - pg_index), sequences (but see also - pg_sequence), views, materialized - views, composite types, and TOAST tables; see relkind. - Below, when we mean all of these - kinds of objects we speak of relations. Not all - columns are meaningful for all relation types. + everything else that has columns or is otherwise similar to a table. + This includes indexes (but see also pg_index), + sequences (but see also pg_sequence), + views, materialized views, composite types, and TOAST tables; + see relkind. + Below, when we mean all of these kinds of objects we speak of + relations. Not all columns are meaningful for all relation + types.
@@ -1895,7 +1900,7 @@ The OID of the data type that corresponds to this table's row type, - if any (zero for indexes, which have no pg_type entry) + if any (zero for indexes, which have no pg_type entry) @@ -2019,7 +2024,7 @@ True if this table is shared across all databases in the cluster. Only - certain system catalogs (such as pg_database) + certain system catalogs (such as pg_database) are shared. @@ -2059,8 +2064,8 @@ Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in - pg_attribute. See also - pg_attribute.attnum. + pg_attribute. See also + pg_attribute.attnum>. @@ -2404,7 +2409,8 @@ key, unique, foreign key, and exclusion constraints on tables. (Column constraints are not treated specially. Every column constraint is equivalent to some table constraint.) - Not-null constraints are represented in the pg_attribute + Not-null constraints are represented in the + pg_attribute catalog, not here. @@ -2707,7 +2713,7 @@ For other cases, a zero appears in conkey and the associated index must be consulted to discover the expression that is constrained. (conkey thus has the - same contents as pg_index.indkey for the + same contents as pg_index.indkey for the index.) @@ -2975,7 +2981,7 @@ track whether the database needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_xact to be shrunk. It is the minimum of the per-table - pg_class.relfrozenxid values. + pg_class.relfrozenxid values. @@ -2989,7 +2995,7 @@ track whether the database needs to be vacuumed in order to prevent multixact ID wraparound or to allow pg_multixact to be shrunk. It is the minimum of the per-table - pg_class.relminmxid values. + pg_class.relminmxid values. @@ -3001,7 +3007,7 @@ The default tablespace for the database. Within this database, all tables for which - pg_class.reltablespace is zero + pg_class.reltablespace is zero will be stored in this tablespace; in particular, all the non-shared system catalogs will be there. @@ -3600,7 +3606,7 @@ (references pg_type.oid) - The OID of the pg_type entry owning this enum value + The OID of the pg_type entry owning this enum value @@ -4094,11 +4100,13 @@ The catalog pg_foreign_table contains - auxiliary information about foreign tables. A foreign table is - primarily represented by a pg_class entry, - just like a regular table. Its pg_foreign_table - entry contains the information that is pertinent only to foreign tables - and not any other kind of relation. + auxiliary information about foreign tables. + A foreign table is primarily represented by a + pg_class + entry, just like a regular table. + Its pg_foreign_table entry contains the + information that is pertinent only to foreign tables and not any other kind + of relation.
@@ -4122,7 +4130,7 @@ (references pg_class.oid) - OID of the pg_class entry for this foreign table + The OID of the pg_class entry for this foreign table @@ -4160,7 +4168,7 @@ The catalog pg_index contains part of the information about indexes. The rest is mostly in - pg_class. + pg_class.
@@ -4184,7 +4192,7 @@ (references pg_class.oid) - The OID of the pg_class entry for this index + The OID of the pg_class entry for this index @@ -4194,7 +4202,7 @@ (references pg_class.oid) - The OID of the pg_class entry for the table this index is for + The OID of the pg_class entry for the table this index is for @@ -5391,7 +5399,7 @@ (references pg_class.oid) - The OID of the pg_class entry for this partitioned table + The OID of the pg_class entry for this partitioned table @@ -5420,7 +5428,7 @@ (references pg_class.oid) - The OID of the pg_class entry for the default partition + The OID of the pg_class entry for the default partition of this partitioned table, or zero if this partitioned table does not have a default partition. @@ -5600,7 +5608,7 @@ Policies stored in pg_policy are applied only when - pg_class.relrowsecurity is set for + pg_class.relrowsecurity is set for their table. @@ -5625,7 +5633,7 @@ If prokind indicates that the entry is for an aggregate function, there should be a matching row in - pg_aggregate. + pg_aggregate.
@@ -6555,7 +6563,8 @@ The catalog pg_sequence contains information about sequences. Some of the information about sequences, such as the name and - the schema, is in pg_class. + the schema, is in + pg_class
@@ -6579,7 +6588,7 @@ (references pg_class.oid) - The OID of the pg_class entry for this sequence + The OID of the pg_class entry for this sequence @@ -7338,13 +7347,14 @@ The catalog pg_statistic_ext_data - holds data for extended planner statistics defined in pg_statistic_ext. + holds data for extended planner statistics defined in + pg_statistic_ext. Each row in this catalog corresponds to a statistics object created with . - Like pg_statistic, + Like pg_statistic, pg_statistic_ext_data should not be readable by the public, since the contents might be considered sensitive. (Example: most common combinations of values in columns might be quite @@ -7352,7 +7362,7 @@ pg_stats_ext is a publicly readable view on pg_statistic_ext_data (after joining - with pg_statistic_ext) that only exposes + with pg_statistic_ext) that only exposes information about those tables and columns that are readable by the current user. @@ -7938,7 +7948,7 @@ (references pg_constraint.oid) - The pg_constraint entry associated with the trigger, if any + The pg_constraint entry associated with the trigger, if any @@ -8036,7 +8046,7 @@ When tgconstraint is nonzero, tgconstrrelid, tgconstrindid, tgdeferrable, and tginitdeferred are - largely redundant with the referenced pg_constraint entry. + largely redundant with the referenced pg_constraint entry. However, it is possible for a non-deferrable trigger to be associated with a deferrable constraint: foreign key constraints can have some deferrable and some non-deferrable triggers. @@ -8183,7 +8193,7 @@ (references pg_ts_config.oid) - The OID of the pg_ts_config entry owning this map entry + The OID of the pg_ts_config entry owning this map entry @@ -8697,11 +8707,11 @@ If this is a composite type (see typtype), then this column points to - the pg_class entry that defines the + the pg_class entry that defines the corresponding table. (For a free-standing composite type, the - pg_class entry doesn't really represent + pg_class entry doesn't really represent a table, but it is needed anyway for the type's - pg_attribute entries to link to.) + pg_attribute entries to link to.) Zero for non-composite types. @@ -9964,8 +9974,9 @@ The view pg_hba_file_rules provides a summary of - the contents of the client authentication configuration - file, pg_hba.conf. A row appears in this view for each + the contents of the client authentication configuration file, + pg_hba.conf. + A row appears in this view for each non-empty, non-comment line in the file, with annotations indicating whether the rule could be applied successfully. @@ -10206,8 +10217,10 @@ individual tuples of relations, transaction IDs (both virtual and permanent IDs), and general database objects (identified by class OID and object OID, - in the same way as in pg_description or - pg_depend). Also, the right to extend a + in the same way as in + pg_description + or pg_depend). + Also, the right to extend a relation is represented as a separate lockable object. Also, advisory locks can be taken on numbers that have user-defined meanings. @@ -10447,7 +10460,7 @@ pg_locks provides a global view of all locks in the database cluster, not only those relevant to the current database. Although its relation column can be joined - against pg_class.oid to identify locked + against pg_class.oid to identify locked relations, this will only work correctly for relations in the current database (those for which the database column is either the current database's OID or zero). @@ -10944,8 +10957,9 @@ The view pg_publication_tables provides information about the mapping between publications and the tables they - contain. Unlike the underlying - catalog pg_publication_rel, this view expands + contain. Unlike the underlying catalog + pg_publication_rel, + this view expands publications defined as FOR ALL TABLES, so for such publications there will be a row for each eligible table. @@ -11505,7 +11519,7 @@ The pg_rules view excludes the ON SELECT rules of views and materialized views; those can be seen in - pg_views and pg_matviews. + pg_views and pg_matviews. @@ -12334,7 +12348,7 @@ the information stored in the pg_statistic catalog. This view allows access only to rows of - pg_statistic that correspond to tables the + pg_statistic that correspond to tables the user has permission to read, and therefore it is safe to allow public read access to this view. @@ -12343,7 +12357,7 @@ pg_stats is also designed to present the information in a more readable format than the underlying catalog — at the cost that its schema must be extended whenever new slot types - are defined for pg_statistic. + are defined for pg_statistic.
@@ -12545,7 +12559,7 @@ linkend="catalog-pg-statistic-ext">pg_statistic_ext and pg_statistic_ext_data catalogs. This view allows access only to rows of - pg_statistic_ext and pg_statistic_ext_data + pg_statistic_ext and pg_statistic_ext_data that correspond to tables the user has permission to read, and therefore it is safe to allow public read access to this view. @@ -12554,7 +12568,7 @@ pg_stats_ext is also designed to present the information in a more readable format than the underlying catalogs — at the cost that its schema must be extended whenever new types - of extended statistics are added to pg_statistic_ext. + of extended statistics are added to pg_statistic_ext.
-- 2.26.2 --=-=-=--