pgsql: Avoid possible dangling-pointer access in tsearch_readline_callb

2020-09-23 Thread Tom Lane
Avoid possible dangling-pointer access in tsearch_readline_callback. tsearch_readline() saves the string pointer it returns to the caller for possible use in the associated error context callback. However, the caller will usually pfree that string sometime before it next calls tsearch_readline(),

pgsql: Avoid possible dangling-pointer access in tsearch_readline_callb

2020-09-23 Thread Tom Lane
Avoid possible dangling-pointer access in tsearch_readline_callback. tsearch_readline() saves the string pointer it returns to the caller for possible use in the associated error context callback. However, the caller will usually pfree that string sometime before it next calls tsearch_readline(),

pgsql: Avoid possible dangling-pointer access in tsearch_readline_callb

2020-09-23 Thread Tom Lane
Avoid possible dangling-pointer access in tsearch_readline_callback. tsearch_readline() saves the string pointer it returns to the caller for possible use in the associated error context callback. However, the caller will usually pfree that string sometime before it next calls tsearch_readline(),

pgsql: Avoid possible dangling-pointer access in tsearch_readline_callb

2020-09-23 Thread Tom Lane
Avoid possible dangling-pointer access in tsearch_readline_callback. tsearch_readline() saves the string pointer it returns to the caller for possible use in the associated error context callback. However, the caller will usually pfree that string sometime before it next calls tsearch_readline(),

pgsql: Avoid possible dangling-pointer access in tsearch_readline_callb

2020-09-23 Thread Tom Lane
Avoid possible dangling-pointer access in tsearch_readline_callback. tsearch_readline() saves the string pointer it returns to the caller for possible use in the associated error context callback. However, the caller will usually pfree that string sometime before it next calls tsearch_readline(),

pgsql: Avoid possible dangling-pointer access in tsearch_readline_callb

2020-09-23 Thread Tom Lane
Avoid possible dangling-pointer access in tsearch_readline_callback. tsearch_readline() saves the string pointer it returns to the caller for possible use in the associated error context callback. However, the caller will usually pfree that string sometime before it next calls tsearch_readline(),

pgsql: Avoid possible dangling-pointer access in tsearch_readline_callb

2020-09-23 Thread Tom Lane
Avoid possible dangling-pointer access in tsearch_readline_callback. tsearch_readline() saves the string pointer it returns to the caller for possible use in the associated error context callback. However, the caller will usually pfree that string sometime before it next calls tsearch_readline(),

pgsql: Improve error cursor positions for problems with partition bound

2020-09-23 Thread Tom Lane
Improve error cursor positions for problems with partition bounds. We failed to pass down the query string to check_new_partition_bound, so that its attempts to provide error cursor positions were for naught; one must have the query string to get parser_errposition to do anything. Adjust its API t

pgsql: Fix missing fsync of SLRU directories.

2020-09-23 Thread Thomas Munro
Fix missing fsync of SLRU directories. Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be21), and in older branches all SLRUs were missed. Back-patch to all supported releases. Revi

pgsql: Fix missing fsync of SLRU directories.

2020-09-23 Thread Thomas Munro
Fix missing fsync of SLRU directories. Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be21), and in older branches all SLRUs were missed. Back-patch to all supported releases. Revi

pgsql: Fix missing fsync of SLRU directories.

2020-09-23 Thread Thomas Munro
Fix missing fsync of SLRU directories. Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be21), and in older branches all SLRUs were missed. Back-patch to all supported releases. Revi

pgsql: Fix missing fsync of SLRU directories.

2020-09-23 Thread Thomas Munro
Fix missing fsync of SLRU directories. Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be21), and in older branches all SLRUs were missed. Back-patch to all supported releases. Revi

pgsql: Fix missing fsync of SLRU directories.

2020-09-23 Thread Thomas Munro
Fix missing fsync of SLRU directories. Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be21), and in older branches all SLRUs were missed. Back-patch to all supported releases. Revi

pgsql: Fix missing fsync of SLRU directories.

2020-09-23 Thread Thomas Munro
Fix missing fsync of SLRU directories. Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be21), and in older branches all SLRUs were missed. Back-patch to all supported releases. Revi

pgsql: Fix missing fsync of SLRU directories.

2020-09-23 Thread Thomas Munro
Fix missing fsync of SLRU directories. Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be21), and in older branches all SLRUs were missed. Back-patch to all supported releases. Revi

pgsql: Improve behavior of tsearch_readline(), and remove t_readline().

2020-09-23 Thread Tom Lane
Improve behavior of tsearch_readline(), and remove t_readline(). Commit fbeb9da22, which added the tsearch_readline APIs, left t_readline() in place as a compatibility measure. But that function has been unused and deprecated for twelve years now, so that seems like enough time to remove it. Doi