public inbox for [email protected]help / color / mirror / Atom feed
[PATCH v5] CatCache expiration feature 9+ messages / 4 participants [nested] [flat]
* [PATCH v5] CatCache expiration feature @ 2020-11-06 08:27 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 9+ messages in thread From: Kyotaro Horiguchi @ 2020-11-06 08:27 UTC (permalink / raw) --- src/backend/access/transam/xact.c | 3 + src/backend/utils/cache/catcache.c | 118 +++++++++++++++++++++++++++++ src/backend/utils/misc/guc.c | 12 +++ src/include/utils/catcache.h | 20 +++++ 4 files changed, 153 insertions(+) diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index af6afcebb1..a246fcc4c0 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1086,6 +1086,9 @@ static void AtStart_Cache(void) { AcceptInvalidationMessages(); + + if (xactStartTimestamp != 0) + SetCatCacheClock(xactStartTimestamp); } /* diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 3613ae5f44..b457fed7ab 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -38,6 +38,7 @@ #include "utils/rel.h" #include "utils/resowner_private.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* #define CACHEDEBUG */ /* turns DEBUG elogs on */ @@ -60,9 +61,18 @@ #define CACHE_elog(...) #endif +/* + * GUC variable to define the minimum age of entries that will be considered + * to be evicted in seconds. -1 to disable the feature. + */ +int catalog_cache_prune_min_age = -1; + /* Cache management header --- pointer is NULL until created */ static CatCacheHeader *CacheHdr = NULL; +/* Clock for the last accessed time of a catcache entry. */ +TimestampTz catcacheclock = 0; + static inline HeapTuple SearchCatCacheInternal(CatCache *cache, int nkeys, Datum v1, Datum v2, @@ -74,6 +84,7 @@ static pg_noinline HeapTuple SearchCatCacheMiss(CatCache *cache, Index hashIndex, Datum v1, Datum v2, Datum v3, Datum v4); +static bool CatCacheCleanupOldEntries(CatCache *cp); static uint32 CatalogCacheComputeHashValue(CatCache *cache, int nkeys, Datum v1, Datum v2, Datum v3, Datum v4); @@ -99,6 +110,12 @@ static void CatCacheFreeKeys(TupleDesc tupdesc, int nkeys, int *attnos, static void CatCacheCopyKeys(TupleDesc tupdesc, int nkeys, int *attnos, Datum *srckeys, Datum *dstkeys); +/* GUC assign function */ +void +assign_catalog_cache_prune_min_age(int newval, void *extra) +{ + catalog_cache_prune_min_age = newval; +} /* * internal support functions @@ -863,6 +880,10 @@ RehashCatCache(CatCache *cp) int newnbuckets; int i; + /* try removing old entries before expanding hash */ + if (CatCacheCleanupOldEntries(cp)) + return; + elog(DEBUG1, "rehashing catalog cache id %d for %s; %d tups, %d buckets", cp->id, cp->cc_relname, cp->cc_ntup, cp->cc_nbuckets); @@ -1264,6 +1285,16 @@ SearchCatCacheInternal(CatCache *cache, */ dlist_move_head(bucket, &ct->cache_elem); + /* + * Prolong life of this entry. Since we want run as less instructions + * as possible and want the branch be stable for performance reasons, + * we don't care of wrap-around and possible false-negative for old + * entries. The window is quite narrow and the counter doesn't gets so + * large while expiration is active. + */ + ct->naccess++; + ct->lastaccess = catcacheclock; + /* * If it's a positive entry, bump its refcount and return it. If it's * negative, we can report failure to the caller. @@ -1425,6 +1456,91 @@ SearchCatCacheMiss(CatCache *cache, return &ct->tuple; } +/* + * CatCacheCleanupOldEntries - Remove infrequently-used entries + * + * Catcache entries happen to be left unused for a long time for several + * reasons. Remove such entries to prevent catcache from bloating. It is based + * on the similar algorithm with buffer eviction. Entries that are accessed + * several times in a certain period live longer than those that have had less + * access in the same duration. + */ +static bool +CatCacheCleanupOldEntries(CatCache *cp) +{ + int nremoved = 0; + int i; + long oldest_ts = catcacheclock; + long age; + int us; + + /* Return immediately if disabled */ + if (likely(catalog_cache_prune_min_age < 0)) + return false; + + /* Don't scan the hash when we know we don't have prunable entries */ + TimestampDifference(cp->cc_oldest_ts, catcacheclock, &age, &us); + if (age < catalog_cache_prune_min_age) + return false; + + /* Scan over the whole hash to find entries to remove */ + for (i = 0 ; i < cp->cc_nbuckets ; i++) + { + dlist_mutable_iter iter; + + dlist_foreach_modify(iter, &cp->cc_bucket[i]) + { + CatCTup *ct = dlist_container(CatCTup, cache_elem, iter.cur); + + /* Don't remove referenced entries */ + if (ct->refcount == 0 && + (ct->c_list == NULL || ct->c_list->refcount == 0)) + { + /* + * Calculate the duration from the time from the last access + * to the "current" time. catcacheclock is updated + * per-statement basis and additionaly udpated periodically + * during a long running query. + */ + TimestampDifference(ct->lastaccess, catcacheclock, &age, &us); + + if (age > catalog_cache_prune_min_age) + { + /* + * Entries that are not accessed after the last pruning + * are removed in that seconds, and their lives are + * prolonged according to how many times they are accessed + * up to three times of the duration. We don't try shrink + * buckets since pruning effectively caps catcache + * expansion in the long term. + */ + ct->naccess = Min(2, ct->naccess); + if (--ct->naccess == 0) + { + CatCacheRemoveCTup(cp, ct); + nremoved++; + + /* don't update oldest_ts by removed entry */ + continue; + } + } + } + + /* update oldest timestamp if the entry remains alive */ + if (ct->lastaccess < oldest_ts) + oldest_ts = ct->lastaccess; + } + } + + cp->cc_oldest_ts = oldest_ts; + + if (nremoved > 0) + elog(DEBUG1, "pruning catalog cache id=%d for %s: removed %d / %d", + cp->id, cp->cc_relname, nremoved, cp->cc_ntup + nremoved); + + return nremoved > 0; +} + /* * ReleaseCatCache * @@ -1888,6 +2004,8 @@ CatalogCacheCreateEntry(CatCache *cache, HeapTuple ntp, Datum *arguments, ct->dead = false; ct->negative = negative; ct->hash_value = hashValue; + ct->naccess = 1; + ct->lastaccess = catcacheclock; dlist_push_head(&cache->cc_bucket[hashIndex], &ct->cache_elem); diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index bb34630e8e..95213853aa 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -88,6 +88,7 @@ #include "utils/acl.h" #include "utils/builtins.h" #include "utils/bytea.h" +#include "utils/catcache.h" #include "utils/float.h" #include "utils/guc_tables.h" #include "utils/memutils.h" @@ -3399,6 +3400,17 @@ static struct config_int ConfigureNamesInt[] = check_huge_page_size, NULL, NULL }, + { + {"catalog_cache_prune_min_age", PGC_USERSET, RESOURCES_MEM, + gettext_noop("System catalog cache entries that are living unused more than this seconds are considered for removal."), + gettext_noop("The value of -1 turns off pruning."), + GUC_UNIT_S + }, + &catalog_cache_prune_min_age, + -1, -1, INT_MAX, + NULL, assign_catalog_cache_prune_min_age, NULL + }, + /* End-of-list marker */ { {NULL, 0, 0, NULL, NULL}, NULL, 0, 0, 0, NULL, NULL, NULL diff --git a/src/include/utils/catcache.h b/src/include/utils/catcache.h index f4aa316604..a11736f767 100644 --- a/src/include/utils/catcache.h +++ b/src/include/utils/catcache.h @@ -22,6 +22,7 @@ #include "access/htup.h" #include "access/skey.h" +#include "datatype/timestamp.h" #include "lib/ilist.h" #include "utils/relcache.h" @@ -61,6 +62,7 @@ typedef struct catcache slist_node cc_next; /* list link */ ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for heap * scans */ + TimestampTz cc_oldest_ts; /* timestamp of the oldest tuple in the hash */ /* * Keep these at the end, so that compiling catcache.c with CATCACHE_STATS @@ -119,6 +121,8 @@ typedef struct catctup bool dead; /* dead but not yet removed? */ bool negative; /* negative cache entry? */ HeapTupleData tuple; /* tuple management header */ + unsigned int naccess; /* # of access to this entry */ + TimestampTz lastaccess; /* timestamp of the last usage */ /* * The tuple may also be a member of at most one CatCList. (If a single @@ -189,6 +193,22 @@ typedef struct catcacheheader /* this extern duplicates utils/memutils.h... */ extern PGDLLIMPORT MemoryContext CacheMemoryContext; + +/* for guc.c, not PGDLLPMPORT'ed */ +extern int catalog_cache_prune_min_age; + +/* source clock for access timestamp of catcache entries */ +extern TimestampTz catcacheclock; + +/* SetCatCacheClock - set catcache timestamp source clodk */ +static inline void +SetCatCacheClock(TimestampTz ts) +{ + catcacheclock = ts; +} + +extern void assign_catalog_cache_prune_min_age(int newval, void *extra); + extern void CreateCacheMemoryContext(void); extern CatCache *InitCatCache(int id, Oid reloid, Oid indexoid, -- 2.18.4 ----Next_Part(Mon_Nov__9_18_34_47_2020_166)---- ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-01-20 20:22 Karl O. Pinc <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Karl O. Pinc @ 2023-01-20 20:22 UTC (permalink / raw) To: Alvaro Herrera <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> On Fri, 20 Jan 2023 20:12:38 +0100 Alvaro Herrera <[email protected]> wrote: > Ah, I wanted to attach the two remaining patches and forgot. Attached are 2 alternatives: (They touch separate files so the ordering is meaningless.) v8-0001-List-trusted-and-obsolete-extensions.patch Instead of putting [trusted] and [obsolete] in the titles of the modules, like v7 does, add a list of them into the text. v8-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch This frobs the PDF style sheet so that when sect1 is used in the appendix for the contrib directory, there is a page break before every sect1. This puts each module/extension onto a separate page, but only for the contrib appendix. Aside from hardcoding the "contrib" id, which I suppose isn't too bad since it's publicly exposed as a HTML anchor (or URL component?) and unlikely to change, this also means that the contrib documentation can't use <section> instead of <sect1>. Sometimes I think I only know enough XSLT to get into trouble. While v8 is "right", I can't say if it is a good idea/good practice. Regards, Karl <[email protected]> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein Attachments: [text/x-patch] v8-0001-List-trusted-and-obsolete-extensions.patch (1.9K, ../../[email protected]/2-v8-0001-List-trusted-and-obsolete-extensions.patch) download | inline diff: diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml index 8816e06337..87833915e9 100644 --- a/doc/src/sgml/contrib.sgml +++ b/doc/src/sgml/contrib.sgml @@ -84,6 +84,31 @@ CREATE EXTENSION <replaceable>extension_name</replaceable>; provide access to outside-the-database functionality. </para> + <para id="contrib-trusted-extensions">These are the trusted extensions: + <simplelist type="inline"> + <member><xref linkend="btree-gin"/></member> + <member><xref linkend="btree-gist"/></member> + <member><xref linkend="citext"/></member> + <member><xref linkend="cube"/></member> + <member><xref linkend="dict-int"/></member> + <member><xref linkend="fuzzystrmatch"/></member> + <member><xref linkend="hstore"/></member> + <member><xref linkend="intarray"/></member> + <member><xref linkend="isn"/></member> + <member><xref linkend="lo"/></member> + <member><xref linkend="ltree"/></member> + <member><xref linkend="pgcrypto"/></member> + <member><xref linkend="pgtrgm"/></member> + <member><xref linkend="seg"/></member> + <member><xref linkend="tablefunc"/></member> + <member><xref linkend="tcn"/></member> + <member><xref linkend="tsm-system-rows"/></member> + <member><xref linkend="tsm-system-time"/></member> + <member><xref linkend="unaccent"/></member> + <member><xref linkend="uuid-ossp"/></member> + </simplelist> + </para> + <para> Many extensions allow you to install their objects in a schema of your choice. To do that, add <literal>SCHEMA @@ -100,6 +125,15 @@ CREATE EXTENSION <replaceable>extension_name</replaceable>; component for details. </para> + <para id="contrib-obsolete"> + These modules and extensions are obsolete: + + <simplelist type="inline"> + <member><xref linkend="intagg"/></member> + <member><xref linkend="xml2"/></member> + </simplelist> + </para> + &adminpack; &amcheck; &auth-delay; [text/x-patch] v8-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch (480B, ../../[email protected]/3-v8-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch) download | inline diff: diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl index 0c4dff92c4..68a46f9e24 100644 --- a/doc/src/sgml/stylesheet-fo.xsl +++ b/doc/src/sgml/stylesheet-fo.xsl @@ -132,4 +132,12 @@ </fo:bookmark> </xsl:template> +<!-- Every sect1 in the appendix describing contributed modules + gets a page break --> + +<xsl:template match="id('contrib')/sect1"> + <fo:block break-after='page'/> + <xsl:apply-imports/> +</xsl:template> + </xsl:stylesheet> ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-01-21 14:11 Karl O. Pinc <[email protected]> parent: Karl O. Pinc <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Karl O. Pinc @ 2023-01-21 14:11 UTC (permalink / raw) To: Alvaro Herrera <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> Attached are 2 v9 patch versions. I don't think I like them. I think the v8 versions are better. But I thought it wouldn't hurt to show them to you. On Fri, 20 Jan 2023 14:22:25 -0600 "Karl O. Pinc" <[email protected]> wrote: > Attached are 2 alternatives: > (They touch separate files so the ordering is meaningless.) > > > v8-0001-List-trusted-and-obsolete-extensions.patch > > Instead of putting [trusted] and [obsolete] in the titles > of the modules, like v7 does, add a list of them into the text. v9 puts the list in vertical format, 5 columns. But the column spacing in HTML is ugly, and I don't see a parameter to set to change it. I suppose we could do more work on the stylesheets, but this seems excessive. It looks good in PDF, but the page break in the middle of the paragraph is ugly. (US-Letter) Again (without forcing a hard page break by frobbing the stylesheet and adding a processing instruction), I don't see a a good way to fix the page break. (sagehill.net says that soft page breaks don't work. I didn't try it.) > v8-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch > > This frobs the PDF style sheet so that when sect1 is used > in the appendix for the contrib directory, there is a page > break before every sect1. This puts each module/extension > onto a separate page, but only for the contrib appendix. > > Aside from hardcoding the "contrib" id, which I suppose isn't > too bad since it's publicly exposed as a HTML anchor (or URL > component?) and unlikely to change, this also means that the > contrib documentation can't use <section> instead of <sect1>. v9 supports using <section> instead of just <sect1>. But I don't know that it's worth it -- the appendix is committed to sect* entities. Once you start with sect* the stylesheet does not allow "section" use to be interspersed. All the sect*s would have to be changed to "section" throughout the appendix and I don't see that happening. Regards, Karl <[email protected]> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein Attachments: [text/x-patch] v9-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch (502B, ../../[email protected]/2-v9-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch) download | inline diff: diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl index 0c4dff92c4..9ce36c7279 100644 --- a/doc/src/sgml/stylesheet-fo.xsl +++ b/doc/src/sgml/stylesheet-fo.xsl @@ -132,4 +132,12 @@ </fo:bookmark> </xsl:template> +<!-- Every sect1 in the appendix describing contributed modules + gets a page break --> + +<xsl:template match="id('contrib')/sect1|id('contrib')/section"> + <fo:block break-after='page'/> + <xsl:apply-imports/> +</xsl:template> + </xsl:stylesheet> [text/x-patch] v9-0001-List-trusted-and-obsolete-extensions.patch (1.9K, ../../[email protected]/3-v9-0001-List-trusted-and-obsolete-extensions.patch) download | inline diff: diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml index 12c79b798b..077184d90d 100644 --- a/doc/src/sgml/contrib.sgml +++ b/doc/src/sgml/contrib.sgml @@ -84,6 +84,31 @@ CREATE EXTENSION <replaceable>extension_name</replaceable>; provide access to outside-the-database functionality. </para> + <para id="contrib-trusted-extensions">These are the trusted extensions: + <simplelist type="vert" columns="5"> + <member><xref linkend="btree-gin"/></member> + <member><xref linkend="btree-gist"/></member> + <member><xref linkend="citext"/></member> + <member><xref linkend="cube"/></member> + <member><xref linkend="dict-int"/></member> + <member><xref linkend="fuzzystrmatch"/></member> + <member><xref linkend="hstore"/></member> + <member><xref linkend="intarray"/></member> + <member><xref linkend="isn"/></member> + <member><xref linkend="lo"/></member> + <member><xref linkend="ltree"/></member> + <member><xref linkend="pgcrypto"/></member> + <member><xref linkend="pgtrgm"/></member> + <member><xref linkend="seg"/></member> + <member><xref linkend="tablefunc"/></member> + <member><xref linkend="tcn"/></member> + <member><xref linkend="tsm-system-rows"/></member> + <member><xref linkend="tsm-system-time"/></member> + <member><xref linkend="unaccent"/></member> + <member><xref linkend="uuid-ossp"/></member> + </simplelist> + </para> + <para> Many extensions allow you to install their objects in a schema of your choice. To do that, add <literal>SCHEMA @@ -100,6 +125,15 @@ CREATE EXTENSION <replaceable>extension_name</replaceable>; component for details. </para> + <para id="contrib-obsolete"> + These modules and extensions are obsolete: + + <simplelist type="inline"> + <member><xref linkend="intagg"/></member> + <member><xref linkend="xml2"/></member> + </simplelist> + </para> + &adminpack; &amcheck; &auth-delay; ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-01-22 14:09 Karl O. Pinc <[email protected]> parent: Karl O. Pinc <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Karl O. Pinc @ 2023-01-22 14:09 UTC (permalink / raw) To: Alvaro Herrera <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> On Sat, 21 Jan 2023 08:11:43 -0600 "Karl O. Pinc" <[email protected]> wrote: > Attached are 2 v9 patch versions. I don't think I like them. > I think the v8 versions are better. But I thought it > wouldn't hurt to show them to you. > > On Fri, 20 Jan 2023 14:22:25 -0600 > "Karl O. Pinc" <[email protected]> wrote: > > > Attached are 2 alternatives: > > (They touch separate files so the ordering is meaningless.) > > > > > > v8-0001-List-trusted-and-obsolete-extensions.patch > > > > Instead of putting [trusted] and [obsolete] in the titles > > of the modules, like v7 does, add a list of them into the text. > > v9 puts the list in vertical format, 5 columns. > > But the column spacing in HTML is ugly, and I don't > see a parameter to set to change it. I suppose we could > do more work on the stylesheets, but this seems excessive. Come to think of it, this should be fixed by using CSS with a table.simplelist selector. Or something along those lines. But I don't have a serious interest in proceeding further. A inline list seems good enough, even if it does not stand out in a visual scan of the page. There is a certain amount of visual-standout due to all the hyperlinks next to each other in the inline presentation. Regards, Karl <[email protected]> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-01-22 20:42 Karl O. Pinc <[email protected]> parent: Karl O. Pinc <[email protected]> 0 siblings, 2 replies; 9+ messages in thread From: Karl O. Pinc @ 2023-01-22 20:42 UTC (permalink / raw) To: Alvaro Herrera <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> On Sun, 22 Jan 2023 08:09:03 -0600 "Karl O. Pinc" <[email protected]> wrote: > On Sat, 21 Jan 2023 08:11:43 -0600 > "Karl O. Pinc" <[email protected]> wrote: > > > Attached are 2 v9 patch versions. I don't think I like them. > > I think the v8 versions are better. But I thought it > > wouldn't hurt to show them to you. > > > > On Fri, 20 Jan 2023 14:22:25 -0600 > > "Karl O. Pinc" <[email protected]> wrote: > > > > > Attached are 2 alternatives: > > > (They touch separate files so the ordering is meaningless.) > > > > > > > > > v8-0001-List-trusted-and-obsolete-extensions.patch > > > > > > Instead of putting [trusted] and [obsolete] in the titles > > > of the modules, like v7 does, add a list of them into the text. > > > > > > > v9 puts the list in vertical format, 5 columns. > > > > But the column spacing in HTML is ugly, and I don't > > see a parameter to set to change it. I suppose we could > > do more work on the stylesheets, but this seems excessive. > > Come to think of it, this should be fixed by using CSS > with a > > table.simplelist Actually, this CSS, added to doc/src/sgml/stylesheet.css, makes the column spacing look pretty good: /* Adequate spacing between columns in a simplelist non-inline table */ .simplelist td { padding-left: 2em; padding-right: 2em; } (No point in specifying table, since td only shows up in tables.) Note that the default simplelist type value is "vert", causing a 1 column vertical display. There are a number of these in the documenation. I kind of like what the above css does to these layouts. An example would be the layout in doc/src/sgml/html/datatype-boolean.html, which is the "Data Types" section "Boolean Type" sub-section. For other places affected see: grep -l doc/src/sgml/*.sgml simplelist Attached are 2 patches: v10-0001-List-trusted-and-obsolete-extensions.patch List trusted extenions in 4 columns, with the CSS altered to put spacing between vertical columns. I changed this from the 5 columns of v9 because with 5 columns there was a little bit of overflow into the right hand margin of a US-letter PDF. The PDF still has an ugly page break right before the table. To avoid that use the v8 version, which presents the list inline. v10-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch This is exactly like the v8 version. See my comments earlier about v8 v.s. v9. Regards, Karl <[email protected]> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein Attachments: [text/x-patch] v10-0001-List-trusted-and-obsolete-extensions.patch (2.3K, ../../[email protected]/2-v10-0001-List-trusted-and-obsolete-extensions.patch) download | inline diff: diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml index 12c79b798b..b9f3268cad 100644 --- a/doc/src/sgml/contrib.sgml +++ b/doc/src/sgml/contrib.sgml @@ -84,6 +84,32 @@ CREATE EXTENSION <replaceable>extension_name</replaceable>; provide access to outside-the-database functionality. </para> + <para id="contrib-trusted-extensions">These are the trusted extensions: + </para> + + <simplelist type="vert" columns="4"> + <member><xref linkend="btree-gin"/></member> + <member><xref linkend="btree-gist"/></member> + <member><xref linkend="citext"/></member> + <member><xref linkend="cube"/></member> + <member><xref linkend="dict-int"/></member> + <member><xref linkend="fuzzystrmatch"/></member> + <member><xref linkend="hstore"/></member> + <member><xref linkend="intarray"/></member> + <member><xref linkend="isn"/></member> + <member><xref linkend="lo"/></member> + <member><xref linkend="ltree"/></member> + <member><xref linkend="pgcrypto"/></member> + <member><xref linkend="pgtrgm"/></member> + <member><xref linkend="seg"/></member> + <member><xref linkend="tablefunc"/></member> + <member><xref linkend="tcn"/></member> + <member><xref linkend="tsm-system-rows"/></member> + <member><xref linkend="tsm-system-time"/></member> + <member><xref linkend="unaccent"/></member> + <member><xref linkend="uuid-ossp"/></member> + </simplelist> + <para> Many extensions allow you to install their objects in a schema of your choice. To do that, add <literal>SCHEMA @@ -100,6 +126,15 @@ CREATE EXTENSION <replaceable>extension_name</replaceable>; component for details. </para> + <para id="contrib-obsolete"> + These modules and extensions are obsolete: + + <simplelist type="inline"> + <member><xref linkend="intagg"/></member> + <member><xref linkend="xml2"/></member> + </simplelist> + </para> + &adminpack; &amcheck; &auth-delay; diff --git a/doc/src/sgml/stylesheet.css b/doc/src/sgml/stylesheet.css index 6410a47958..61d8a6537d 100644 --- a/doc/src/sgml/stylesheet.css +++ b/doc/src/sgml/stylesheet.css @@ -163,3 +163,6 @@ acronym { font-style: inherit; } width: 75%; } } + +/* Adequate spacing between columns in a simplelist non-inline table */ +table.simplelist td { padding-left: 2em; padding-right: 2em; } [text/x-patch] v10-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch (480B, ../../[email protected]/3-v10-0002-Page-break-before-sect1-in-contrib-appendix-when-pdf.patch) download | inline diff: diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl index 0c4dff92c4..68a46f9e24 100644 --- a/doc/src/sgml/stylesheet-fo.xsl +++ b/doc/src/sgml/stylesheet-fo.xsl @@ -132,4 +132,12 @@ </fo:bookmark> </xsl:template> +<!-- Every sect1 in the appendix describing contributed modules + gets a page break --> + +<xsl:template match="id('contrib')/sect1"> + <fo:block break-after='page'/> + <xsl:apply-imports/> +</xsl:template> + </xsl:stylesheet> ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-03-09 09:27 Alvaro Herrera <[email protected]> parent: Karl O. Pinc <[email protected]> 1 sibling, 0 replies; 9+ messages in thread From: Alvaro Herrera @ 2023-03-09 09:27 UTC (permalink / raw) To: Karl O. Pinc <[email protected]>; +Cc: w^3 <[email protected]> Hello pgsql-web, We're looking to improve the contrib docs with a list of trusted extensions. In order for that look more presentable, Karl has come up with the idea of using a <simplelist> table with multiple columns. That would normally look quite terrible because the cell contents are too close to one another, so he came up with the idea of increasing the padding, as shown in this patch. I think this is good thing, as it can help us use tabular <simplelist> in other places too. This change requires to change main Postgres doc/src/sgml/stylesheet.css as Karl suggested here: On 2023-Jan-22, Karl O. Pinc wrote: > Actually, this CSS, added to doc/src/sgml/stylesheet.css, > makes the column spacing look pretty good: > > /* Adequate spacing between columns in a simplelist non-inline table */ > table.simplelist td { padding-left: 2em; padding-right: 2em; } > > (No point in specifying table, since td only shows up in tables.) > > Note that the default simplelist type value is "vert", causing a 1 > column vertical display. There are a number of these in the > documenation. I kind of like what the above css does to these > layouts. An example would be the layout in > doc/src/sgml/html/datatype-boolean.html, which is the "Data Types" > section "Boolean Type" sub-section. ... but in addition it needs the pgweb CSS to be updated to match, as in the attached patch. What do you think? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "The eagle never lost so much time, as when he submitted to learn of the crow." (William Blake) Attachments: [text/x-diff] 0001-Add-padding-to-table.simplelist-for-more-readable-ou.patch (745B, ../../[email protected]/2-0001-Add-padding-to-table.simplelist-for-more-readable-ou.patch) download | inline diff: From bb4a5388cbc373789c7548a4a390e37bbab8dbec Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <[email protected]> Date: Thu, 9 Mar 2023 10:22:23 +0100 Subject: [PATCH] Add padding to table.simplelist for more readable output Suggested by Karl Pinc --- media/css/main.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/media/css/main.css b/media/css/main.css index 723366c9..fd082ae4 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1169,6 +1169,12 @@ code, color: var(--doccontent-code-fg-color) !important; } +/** Simplelist */ +#docContent table.simplelist td { + padding-left: 2em; + padding-right: 2em; +} + /** * Various callout boxes for docs, including warning, caution, note, tip */ -- 2.30.2 ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-03-30 04:32 Noah Misch <[email protected]> parent: Karl O. Pinc <[email protected]> 1 sibling, 1 reply; 9+ messages in thread From: Noah Misch @ 2023-03-30 04:32 UTC (permalink / raw) To: Karl O. Pinc <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; PostgreSQL Hackers <[email protected]> On Sun, Jan 22, 2023 at 02:42:46PM -0600, Karl O. Pinc wrote: > v10-0001-List-trusted-and-obsolete-extensions.patch > + <para id="contrib-obsolete"> > + These modules and extensions are obsolete: > + > + <simplelist type="inline"> > + <member><xref linkend="intagg"/></member> > + <member><xref linkend="xml2"/></member> > + </simplelist> > + </para> Commit a013738 incorporated this change. Since xml2 is the only in-tree way to use XSLT from SQL, I think xml2 is not obsolete. Some individual functions, e.g. xml_valid(), are obsolete. (There are years-old threats to render the module obsolete, but this has never happened.) ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-03-30 06:27 Karl O. Pinc <[email protected]> parent: Noah Misch <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Karl O. Pinc @ 2023-03-30 06:27 UTC (permalink / raw) To: Noah Misch <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; PostgreSQL Hackers <[email protected]> On Wed, 29 Mar 2023 21:32:05 -0700 Noah Misch <[email protected]> wrote: > On Sun, Jan 22, 2023 at 02:42:46PM -0600, Karl O. Pinc wrote: > > v10-0001-List-trusted-and-obsolete-extensions.patch > > > + <para id="contrib-obsolete"> > > + These modules and extensions are obsolete: > > + > > + <simplelist type="inline"> > > + <member><xref linkend="intagg"/></member> > > + <member><xref linkend="xml2"/></member> > > + </simplelist> > > + </para> > > Commit a013738 incorporated this change. Since xml2 is the only > in-tree way to use XSLT from SQL, I think xml2 is not obsolete. Some > individual functions, e.g. xml_valid(), are obsolete. (There are > years-old threats to render the module obsolete, but this has never > happened.) Your point seems valid but this is above my station. I have no idea as to how to best resolve this, or even how to make the resolution happen now that the change has been committed. Someone who knows more than me about the situation is needed to change the phrasing, or re-categorize, or rework the xml2 module docs, or come up with new categories of obsolescence-like states, or provide access to libxslt from PG, or something. I am invested in the patch and appreciate being cc-ed. Regards, Karl <[email protected]> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences @ 2023-04-09 18:50 Noah Misch <[email protected]> parent: Karl O. Pinc <[email protected]> 0 siblings, 0 replies; 9+ messages in thread From: Noah Misch @ 2023-04-09 18:50 UTC (permalink / raw) To: Karl O. Pinc <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; PostgreSQL Hackers <[email protected]> On Thu, Mar 30, 2023 at 01:27:05AM -0500, Karl O. Pinc wrote: > On Wed, 29 Mar 2023 21:32:05 -0700 > Noah Misch <[email protected]> wrote: > > > On Sun, Jan 22, 2023 at 02:42:46PM -0600, Karl O. Pinc wrote: > > > v10-0001-List-trusted-and-obsolete-extensions.patch > > > > > + <para id="contrib-obsolete"> > > > + These modules and extensions are obsolete: > > > + > > > + <simplelist type="inline"> > > > + <member><xref linkend="intagg"/></member> > > > + <member><xref linkend="xml2"/></member> > > > + </simplelist> > > > + </para> > > > > Commit a013738 incorporated this change. Since xml2 is the only > > in-tree way to use XSLT from SQL, I think xml2 is not obsolete. Some > > individual functions, e.g. xml_valid(), are obsolete. (There are > > years-old threats to render the module obsolete, but this has never > > happened.) > > Your point seems valid but this is above my station. > I have no idea as to how to best resolve this, or even how to make the > resolution happen now that the change has been committed. I'm inclined to just remove <para id="contrib-obsolete">. While intagg is indeed obsolete, having a one-entry list seems like undue weight. ^ permalink raw reply [nested|flat] 9+ messages in thread
end of thread, other threads:[~2023-04-09 18:50 UTC | newest] Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-11-06 08:27 [PATCH v5] CatCache expiration feature Kyotaro Horiguchi <[email protected]> 2023-01-20 20:22 Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Karl O. Pinc <[email protected]> 2023-01-21 14:11 ` Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Karl O. Pinc <[email protected]> 2023-01-22 14:09 ` Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Karl O. Pinc <[email protected]> 2023-01-22 20:42 ` Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Karl O. Pinc <[email protected]> 2023-03-09 09:27 ` Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Alvaro Herrera <[email protected]> 2023-03-30 04:32 ` Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Noah Misch <[email protected]> 2023-03-30 06:27 ` Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Karl O. Pinc <[email protected]> 2023-04-09 18:50 ` Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences Noah Misch <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox