public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v25 5/5] doc: Add Collation Versions section.
2+ messages / 2 participants
[nested] [flat]

* [PATCH v25 5/5] doc: Add Collation Versions section.
@ 2020-03-11 02:01  Thomas Munro <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Thomas Munro @ 2020-03-11 02:01 UTC (permalink / raw)

Supply a brief introduction to collation version concepts.

Author: Thomas Munro
Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/CAEepm%3D0uEQCpfq_%2BLYFBdArCe4Ot98t1aR4eYiYTe%3DyavQygiQ%40mail.gmail.com
---
 doc/src/sgml/charset.sgml | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml
index 4b4563c5b9..c537bdfc28 100644
--- a/doc/src/sgml/charset.sgml
+++ b/doc/src/sgml/charset.sgml
@@ -948,6 +948,41 @@ CREATE COLLATION ignore_accents (provider = icu, locale = 'und-u-ks-level1-kc-tr
     </tip>
    </sect3>
   </sect2>
+
+  <sect2 id="collation-versions">
+   <title>Collation Versions</title>
+
+   <para>
+    The ordering defined by a collation is not necessarily fixed over time.
+    If a collation changes for any reason, persistent data structures such as
+    b-trees that depend on a stable ordering of text might be corrupted.
+    <productname>PostgreSQL</productname> defends against this by recording
+    the current version of each referenced collation for any index that
+    depends on it in the
+    <link linkend="catalog-pg-depend"><structname>pg_depend</structname></link>
+    catalog, if the collation provider makes it available.  If the provider
+    later begins to report a different version, a warning will be reported
+    when the index is accessed, until either the <xref linkend="sql-reindex"/>
+    or the <xref linkend="sql-alterindex"/> command is used to update the
+    version.
+   </para>
+   <para>
+    Version information is available for collations from the
+    <literal>icu</literal> provider on all operating systems.  For the
+    <literal>libc</literal> provider, versions are currently only available
+    on systems using the GNU C library (most Linux systems).
+   </para>
+
+   <note>
+    <para>
+     When using the GNU C library for collations, the C library's version
+     is used as a proxy for the collation version.  Many Linux distributions
+     change collation definitions only when upgrading the C library, but this
+     approach is imperfect as maintainers are free to back-port newer
+     collation definitions to older C library releases.
+    </para>
+   </note>
+  </sect2>
  </sect1>
 
  <sect1 id="multibyte">
-- 
2.20.1


--lrZ03NoBR/3+SXJZ--





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Remove support for old realpath() API
@ 2024-08-05 06:12  Peter Eisentraut <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2024-08-05 06:12 UTC (permalink / raw)
  To: pgsql-hackers

The now preferred way to call realpath() is by passing NULL as the
second argument and get a malloc'ed result.  We still supported the
old way of providing our own buffer as a second argument, for some
platforms that didn't support the new way yet.  Those were only
Solaris less than version 11 and some older AIX versions (7.1 and
newer appear to support the new variant).  We don't support those
platforms versions anymore, so we can remove this extra code.
From aba5b5b6017eff0baa59698de665058843fe1d05 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Mon, 5 Aug 2024 07:50:27 +0200
Subject: [PATCH] Remove support for old realpath() API

The now preferred way to call realpath() is by passing NULL as the
second argument and get a malloc'ed result.  We still supported the
old way of providing our own buffer as a second argument, for some
platforms that didn't support the new way yet.  Those were only
Solaris less than version 11 and some older AIX versions (7.1 and
newer appear to support the new variant).  We don't support those
platforms versions anymore, so we can remove this extra code.
---
 src/common/exec.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/src/common/exec.c b/src/common/exec.c
index 0bee19c1e53..32fd56532aa 100644
--- a/src/common/exec.c
+++ b/src/common/exec.c
@@ -285,25 +285,6 @@ pg_realpath(const char *fname)
 
 #ifndef WIN32
 	path = realpath(fname, NULL);
-	if (path == NULL && errno == EINVAL)
-	{
-		/*
-		 * Cope with old-POSIX systems that require a user-provided buffer.
-		 * Assume MAXPGPATH is enough room on all such systems.
-		 */
-		char	   *buf = malloc(MAXPGPATH);
-
-		if (buf == NULL)
-			return NULL;		/* assume errno is set */
-		path = realpath(fname, buf);
-		if (path == NULL)		/* don't leak memory */
-		{
-			int			save_errno = errno;
-
-			free(buf);
-			errno = save_errno;
-		}
-	}
 #else							/* WIN32 */
 
 	/*
-- 
2.46.0



Attachments:

  [text/plain] 0001-Remove-support-for-old-realpath-API.patch (1.5K, ../../[email protected]/2-0001-Remove-support-for-old-realpath-API.patch)
  download | inline diff:
From aba5b5b6017eff0baa59698de665058843fe1d05 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Mon, 5 Aug 2024 07:50:27 +0200
Subject: [PATCH] Remove support for old realpath() API

The now preferred way to call realpath() is by passing NULL as the
second argument and get a malloc'ed result.  We still supported the
old way of providing our own buffer as a second argument, for some
platforms that didn't support the new way yet.  Those were only
Solaris less than version 11 and some older AIX versions (7.1 and
newer appear to support the new variant).  We don't support those
platforms versions anymore, so we can remove this extra code.
---
 src/common/exec.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/src/common/exec.c b/src/common/exec.c
index 0bee19c1e53..32fd56532aa 100644
--- a/src/common/exec.c
+++ b/src/common/exec.c
@@ -285,25 +285,6 @@ pg_realpath(const char *fname)
 
 #ifndef WIN32
 	path = realpath(fname, NULL);
-	if (path == NULL && errno == EINVAL)
-	{
-		/*
-		 * Cope with old-POSIX systems that require a user-provided buffer.
-		 * Assume MAXPGPATH is enough room on all such systems.
-		 */
-		char	   *buf = malloc(MAXPGPATH);
-
-		if (buf == NULL)
-			return NULL;		/* assume errno is set */
-		path = realpath(fname, buf);
-		if (path == NULL)		/* don't leak memory */
-		{
-			int			save_errno = errno;
-
-			free(buf);
-			errno = save_errno;
-		}
-	}
 #else							/* WIN32 */
 
 	/*
-- 
2.46.0



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-08-05 06:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 02:01 [PATCH v25 5/5] doc: Add Collation Versions section. Thomas Munro <[email protected]>
2024-08-05 06:12 Remove support for old realpath() API Peter Eisentraut <[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