Re: pgsql: Add hooks for session start and session end

2017-11-15 Thread Tom Lane
d to shift from installcheck to check mode for these > modules. That would involve a buildfarm script change. Seems like expending an awful lot of cycles in support of a rather trivial feature. regards, tom lane

pgsql: Rearrange c.h to create a "compiler characteristics" section.

2017-11-14 Thread Tom Lane
Rearrange c.h to create a "compiler characteristics" section. Generalize section 1 to handle stuff that is principally about the compiler (not libraries), such as attributes, and collect stuff there that had been dropped into various other parts of c.h. Also, push all the gettext macros into

Re: pgsql: PL/Python: Fix potential NULL pointer dereference

2017-11-28 Thread Tom Lane
error_context_stack? regards, tom lane

pgsql: Fix creation of resjunk tlist entries for inherited mixed UPDATE

2017-11-27 Thread Tom Lane
Fix creation of resjunk tlist entries for inherited mixed UPDATE/DELETE. rewriteTargetListUD's processing is dependent on the relkind of the query's target table. That was fine at the time it was made to act that way, even for queries on inheritance trees, because all tables in an inheritance

pgsql: Fix creation of resjunk tlist entries for inherited mixed UPDATE

2017-11-27 Thread Tom Lane
Fix creation of resjunk tlist entries for inherited mixed UPDATE/DELETE. rewriteTargetListUD's processing is dependent on the relkind of the query's target table. That was fine at the time it was made to act that way, even for queries on inheritance trees, because all tables in an inheritance

pgsql: Improve planner's handling of set-returning functions in groupin

2017-11-25 Thread Tom Lane
Improve planner's handling of set-returning functions in grouping columns. Improve query_is_distinct_for() to accept SRFs in the targetlist when we can prove distinctness from a DISTINCT clause. In that case the de-duplication will surely happen after SRF expansion, so the proof still works.

Re: pgsql: Generational memory allocator

2017-11-25 Thread Tom Lane
Andres Freund <and...@anarazel.de> writes: > On 2017-11-25 14:50:41 -0500, Tom Lane wrote: >> Meanwhile, skink has come back with a success as of 0f2458f, rendering >> the other mystery even deeper --- although at least this confirms the >> idea that the cr

pgsql: Update MSVC build process for new timezone data.

2017-11-25 Thread Tom Lane
Update MSVC build process for new timezone data. Missed this dependency in commits 7cce222c9 et al. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6d4ae6a8e782d87ffb6aab62f75787b2722daa2d Modified Files -- src/tools/msvc/Install.pm | 7 --- 1 file

pgsql: Update MSVC build process for new timezone data.

2017-11-25 Thread Tom Lane
Update MSVC build process for new timezone data. Missed this dependency in commits 7cce222c9 et al. Branch -- REL9_4_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1601a9413fbfb98370c3299e3c9da514a0331c6d Modified Files -- src/tools/msvc/Install.pm | 7 ---

pgsql: Update MSVC build process for new timezone data.

2017-11-25 Thread Tom Lane
Update MSVC build process for new timezone data. Missed this dependency in commits 7cce222c9 et al. Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7b0cb5eccdc9f4eb9a52b1d5c9815a7a5161a9fa Modified Files -- src/tools/msvc/Install.pm | 7 ---

pgsql: Update MSVC build process for new timezone data.

2017-11-25 Thread Tom Lane
Update MSVC build process for new timezone data. Missed this dependency in commits 7cce222c9 et al. Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/cd3bde814612ffebe11a754116a70010ae195784 Modified Files -- src/tools/msvc/Install.pm | 7 ---

pgsql: Replace raw timezone source data with IANA's new compact format.

2017-11-25 Thread Tom Lane
Replace raw timezone source data with IANA's new compact format. Traditionally IANA has distributed their timezone data in pure source form, replete with extensive historical comments. As of release 2017c, they've added a compact single-file format that omits comments and abbreviates command

pgsql: Replace raw timezone source data with IANA's new compact format.

2017-11-25 Thread Tom Lane
Replace raw timezone source data with IANA's new compact format. Traditionally IANA has distributed their timezone data in pure source form, replete with extensive historical comments. As of release 2017c, they've added a compact single-file format that omits comments and abbreviates command

pgsql: Replace raw timezone source data with IANA's new compact format.

2017-11-25 Thread Tom Lane
Replace raw timezone source data with IANA's new compact format. Traditionally IANA has distributed their timezone data in pure source form, replete with extensive historical comments. As of release 2017c, they've added a compact single-file format that omits comments and abbreviates command

pgsql: Replace raw timezone source data with IANA's new compact format.

2017-11-25 Thread Tom Lane
Replace raw timezone source data with IANA's new compact format. Traditionally IANA has distributed their timezone data in pure source form, replete with extensive historical comments. As of release 2017c, they've added a compact single-file format that omits comments and abbreviates command

pgsql: Replace raw timezone source data with IANA's new compact format.

2017-11-25 Thread Tom Lane
Replace raw timezone source data with IANA's new compact format. Traditionally IANA has distributed their timezone data in pure source form, replete with extensive historical comments. As of release 2017c, they've added a compact single-file format that omits comments and abbreviates command

pgsql: Replace raw timezone source data with IANA's new compact format.

2017-11-25 Thread Tom Lane
Replace raw timezone source data with IANA's new compact format. Traditionally IANA has distributed their timezone data in pure source form, replete with extensive historical comments. As of release 2017c, they've added a compact single-file format that omits comments and abbreviates command

pgsql: Repair failure with SubPlans in multi-row VALUES lists.

2017-11-25 Thread Tom Lane
Repair failure with SubPlans in multi-row VALUES lists. When nodeValuesscan.c was written, it was impossible to have a SubPlan in VALUES --- any sub-SELECT there would have to be uncorrelated and thereby would produce an InitPlan instead. We therefore took a shortcut in the logic that throws

pgsql: Repair failure with SubPlans in multi-row VALUES lists.

2017-11-25 Thread Tom Lane
Repair failure with SubPlans in multi-row VALUES lists. When nodeValuesscan.c was written, it was impossible to have a SubPlan in VALUES --- any sub-SELECT there would have to be uncorrelated and thereby would produce an InitPlan instead. We therefore took a shortcut in the logic that throws

pgsql: Repair failure with SubPlans in multi-row VALUES lists.

2017-11-25 Thread Tom Lane
Repair failure with SubPlans in multi-row VALUES lists. When nodeValuesscan.c was written, it was impossible to have a SubPlan in VALUES --- any sub-SELECT there would have to be uncorrelated and thereby would produce an InitPlan instead. We therefore took a shortcut in the logic that throws

pgsql: Repair failure with SubPlans in multi-row VALUES lists.

2017-11-25 Thread Tom Lane
Repair failure with SubPlans in multi-row VALUES lists. When nodeValuesscan.c was written, it was impossible to have a SubPlan in VALUES --- any sub-SELECT there would have to be uncorrelated and thereby would produce an InitPlan instead. We therefore took a shortcut in the logic that throws

pgsql: Repair failure with SubPlans in multi-row VALUES lists.

2017-11-25 Thread Tom Lane
Repair failure with SubPlans in multi-row VALUES lists. When nodeValuesscan.c was written, it was impossible to have a SubPlan in VALUES --- any sub-SELECT there would have to be uncorrelated and thereby would produce an InitPlan instead. We therefore took a shortcut in the logic that throws

pgsql: Repair failure with SubPlans in multi-row VALUES lists.

2017-11-25 Thread Tom Lane
Repair failure with SubPlans in multi-row VALUES lists. When nodeValuesscan.c was written, it was impossible to have a SubPlan in VALUES --- any sub-SELECT there would have to be uncorrelated and thereby would produce an InitPlan instead. We therefore took a shortcut in the logic that throws

pgsql: Avoid formally-undefined use of memcpy() in hstoreUniquePairs().

2017-11-25 Thread Tom Lane
Avoid formally-undefined use of memcpy() in hstoreUniquePairs(). hstoreUniquePairs() often called memcpy with equal source and destination pointers. Although this is almost surely harmless in practice, it's undefined according to the letter of the C standard. Some versions of valgrind will

pgsql: Avoid formally-undefined use of memcpy() in hstoreUniquePairs().

2017-11-25 Thread Tom Lane
Avoid formally-undefined use of memcpy() in hstoreUniquePairs(). hstoreUniquePairs() often called memcpy with equal source and destination pointers. Although this is almost surely harmless in practice, it's undefined according to the letter of the C standard. Some versions of valgrind will

pgsql: Avoid formally-undefined use of memcpy() in hstoreUniquePairs().

2017-11-25 Thread Tom Lane
Avoid formally-undefined use of memcpy() in hstoreUniquePairs(). hstoreUniquePairs() often called memcpy with equal source and destination pointers. Although this is almost surely harmless in practice, it's undefined according to the letter of the C standard. Some versions of valgrind will

pgsql: Update buffile.h/.c comments for removal of non-temp option.

2017-11-25 Thread Tom Lane
failure to update BufFileSeek's comment to match the change of its argument type from long to off_t. (I think that might actually have been intentional at the time, but now that 64-bit off_t is nearly universal, it looks anachronistic.) Thomas Munro and Tom Lane Discussion: https://postgr.es/m

Re: pgsql: Remove BufFile's isTemp flag.

2017-11-25 Thread Tom Lane
anything it seems confusing because you'd > miss something when trivially searching the history / comparing > branches. It seems that the vote is 2-1 against renaming that function, so I've committed Thomas' patch without that and with some additional comment-smithing. regards, tom lane

Re: pgsql: Generational memory allocator

2017-11-25 Thread Tom Lane
eems like something that would be good to fix, and I did so. Meanwhile, skink has come back with a success as of 0f2458f, rendering the other mystery even deeper --- although at least this confirms the idea that the crashes we are seeing predate the generation.c patch. regards, tom lane

Re: pgsql: Generational memory allocator

2017-11-25 Thread Tom Lane
the buffer, to reduce resize cycles. I'm inclined to start out with a buffer size of 128 or 256 or so bytes and double it when needed. Anybody have a feeling for a typical size for the "main data" part of a WAL record? regards, tom lane diff --git a/src/backend/ac

pgsql: Fix unstable regression test added by commits 59b71c6fe et al.

2017-11-23 Thread Tom Lane
Fix unstable regression test added by commits 59b71c6fe et al. The query didn't really have a preferred index, leading to platform- specific choices of which one to use. Adjust it to make sure tenk1_hundred is always chosen. Per buildfarm. Branch -- REL9_6_STABLE Details ---

pgsql: Fix unstable regression test added by commits 59b71c6fe et al.

2017-11-23 Thread Tom Lane
Fix unstable regression test added by commits 59b71c6fe et al. The query didn't really have a preferred index, leading to platform- specific choices of which one to use. Adjust it to make sure tenk1_hundred is always chosen. Per buildfarm. Branch -- master Details ---

pgsql: Pad XLogReaderState's main_data buffer more aggressively.

2017-11-26 Thread Tom Lane
Pad XLogReaderState's main_data buffer more aggressively. Originally, we palloc'd this buffer just barely big enough to hold the largest xlog record seen so far. It turns out that that can result in valgrind complaints, because some compilers will emit code that assumes it can safely fetch

pgsql: Pad XLogReaderState's main_data buffer more aggressively.

2017-11-26 Thread Tom Lane
Pad XLogReaderState's main_data buffer more aggressively. Originally, we palloc'd this buffer just barely big enough to hold the largest xlog record seen so far. It turns out that that can result in valgrind complaints, because some compilers will emit code that assumes it can safely fetch

pgsql: Pad XLogReaderState's main_data buffer more aggressively.

2017-11-26 Thread Tom Lane
Pad XLogReaderState's main_data buffer more aggressively. Originally, we palloc'd this buffer just barely big enough to hold the largest xlog record seen so far. It turns out that that can result in valgrind complaints, because some compilers will emit code that assumes it can safely fetch

Re: pgsql: Generational memory allocator

2017-11-26 Thread Tom Lane
Simon Riggs <si...@2ndquadrant.com> writes: > On 27 November 2017 at 05:53, Tom Lane <t...@sss.pgh.pa.us> wrote: >> Well, let's not overthink this, because anything under 8K is going to >> be rounded up to the next power of 2 anyway by aset.c. Based on this >

Re: pgsql: Generational memory allocator

2017-11-26 Thread Tom Lane
Simon Riggs <si...@2ndquadrant.com> writes: > On 27 November 2017 at 04:46, Tom Lane <t...@sss.pgh.pa.us> wrote: >> Well, I'm concerned about the possibility of a lot of palloc thrashing >> if the first bunch of records it reads happen to have steadily increasing >

Re: pgsql: Generational memory allocator

2017-11-26 Thread Tom Lane
Simon Riggs <si...@2ndquadrant.com> writes: > On 27 November 2017 at 06:42, Tom Lane <t...@sss.pgh.pa.us> wrote: >> Sold, will make it so. > So you will like this next patch also, since there is related code > above that stanza. Looks reasonable to me, but I wond

Re: pgsql: Generational memory allocator

2017-11-24 Thread Tom Lane
who has more familiarity with the logical decoding stuff than I do needs to look into that. I tried to narrow down exactly which fetch in SnapBuildProcessNewCid was triggering the failure, with the attached patch. Weirdly, *it does not fail* with this. I have no explanation for that.

pgsql: Clarify old comment about qual_is_pushdown_safe's handling of su

2017-11-28 Thread Tom Lane
Clarify old comment about qual_is_pushdown_safe's handling of subplans. This comment glossed over the difference between initplans and subplans, but they are indeed different for our purposes here. Branch -- master Details ---

Re: pgsql: Add some regression tests that exercise hash join code.

2017-11-29 Thread Tom Lane
Andres Freund <and...@anarazel.de> writes: > Add some regression tests that exercise hash join code. At least one buildfarm member doesn't like this ... regards, tom lane

Re: pgsql: Generational memory allocator

2017-11-26 Thread Tom Lane
Simon Riggs <si...@2ndquadrant.com> writes: > On 26 November 2017 at 08:46, Tom Lane <t...@sss.pgh.pa.us> wrote: >> I've confirmed that the attached is sufficient to stop the valgrind crash >> on my machine. But as I said, I think we should be more aggressive at >&g

pgsql: Fix assorted syscache lookup sloppiness in partition-related cod

2017-11-27 Thread Tom Lane
is that the lookup always fails; but in any case it's pretty useless, so remove it. All of these errors were evidently introduced by the relation partitioning feature. Back-patch to v10 where that came in. Amit Langote and Tom Lane Discussion: https://postgr.es/m/20171127090105.1463.3

pgsql: Fix assorted syscache lookup sloppiness in partition-related cod

2017-11-27 Thread Tom Lane
is that the lookup always fails; but in any case it's pretty useless, so remove it. All of these errors were evidently introduced by the relation partitioning feature. Back-patch to v10 where that came in. Amit Langote and Tom Lane Discussion: https://postgr.es/m/20171127090105.1463.3

pgsql: Fix creation of resjunk tlist entries for inherited mixed UPDATE

2017-11-27 Thread Tom Lane
Fix creation of resjunk tlist entries for inherited mixed UPDATE/DELETE. rewriteTargetListUD's processing is dependent on the relkind of the query's target table. That was fine at the time it was made to act that way, even for queries on inheritance trees, because all tables in an inheritance

pgsql: Mark some more functions as pg_attribute_noreturn().

2017-11-27 Thread Tom Lane
Mark some more functions as pg_attribute_noreturn(). Doing this suppresses Coverity warnings and might allow improved code in some cases. The prospects of that are not so bright as to warrant back-patching, though. Michael Paquier, per Coverity Branch -- master Details ---

pgsql: Ensure sizeof(GenerationChunk) is maxaligned.

2017-11-23 Thread Tom Lane
Ensure sizeof(GenerationChunk) is maxaligned. Per buildfarm. Also improve some comments. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/07bd77b95a7846de2b193d1574951436d5783800 Modified Files -- src/backend/utils/mmgr/generation.c | 41

pgsql: Fix neqjoinsel's behavior for semi/anti join cases.

2017-11-29 Thread Tom Lane
Fix neqjoinsel's behavior for semi/anti join cases. Previously, this function estimated the selectivity as 1 minus eqjoinsel() for the negator equality operator, regardless of join type (I think there was an expectation that eqjoinsel would handle the join type). But actually this is completely

pgsql: Improve error handling in RemovePgTempFiles().

2017-12-04 Thread Tom Lane
Improve error handling in RemovePgTempFiles(). Modify this function and its subsidiaries so that syscall failures are reported via ereport(LOG), rather than silently ignored as before. We don't want to throw a hard ERROR, as that would prevent database startup, and getting rid of leftover

pgsql: Simplify do_pg_start_backup's API by opening pg_tblspc internall

2017-12-04 Thread Tom Lane
Simplify do_pg_start_backup's API by opening pg_tblspc internally. do_pg_start_backup() expects its callers to pass in an open DIR pointer for the pg_tblspc directory, but there's no apparent advantage in that. It complicates the callers without adding any flexibility, and there's no robustness

pgsql: Clean up assorted messiness around AllocateDir() usage.

2017-12-04 Thread Tom Lane
Clean up assorted messiness around AllocateDir() usage. This patch fixes a couple of low-probability bugs that could lead to reporting an irrelevant errno value (and hence possibly a wrong SQLSTATE) concerning directory-open or file-open failures. It also fixes places where we took shortcuts in

pgsql: Fix oversights in new plpgsql test suite infrastructure.

2017-12-16 Thread Tom Lane
Fix oversights in new plpgsql test suite infrastructure. Fix a couple of minor oversights in commit 632b03da3: the tests should be run in database "pl_regression" like the other PLs do, and we should clean up the tests' output cruft during "make clean". Branch -- master Details ---

pgsql: Rethink MemoryContext creation to improve performance.

2017-12-13 Thread Tom Lane
Rethink MemoryContext creation to improve performance. This patch makes a number of interrelated changes to reduce the overhead involved in creating/deleting memory contexts. The key ideas are: * Include the AllocSetContext header of an aset.c context in its first malloc request, rather than

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-16 Thread Tom Lane
Andres Freund <and...@anarazel.de> writes: > On December 16, 2017 5:31:01 PM PST, Tom Lane <t...@sss.pgh.pa.us> wrote: >> The committed test looks quite broken to me: it's missing some & >> operators. Not sure how that translates into failing to fail the >> co

pgsql: Define _WINSOCK_DEPRECATED_NO_WARNINGS in all MSVC builds.

2017-11-16 Thread Tom Lane
Define _WINSOCK_DEPRECATED_NO_WARNINGS in all MSVC builds. Commit 0fb54de9a thought that this was only needed in VS2015 and later, but buildfarm member woodlouse shows that at least VS2013 whines as well. Let's just define it regardless of MSVC version; it should be harmless enough in older

pgsql: Fix bogus logic for checking data dirs' versions within pg_upgra

2017-11-16 Thread Tom Lane
Fix bogus logic for checking data dirs' versions within pg_upgrade. Commit 9be95ef15 failed to cure all of the redundancy here: we were actually calling get_major_server_version() three times for each of the old and new data directories. While that's not enormously expensive, it's still sloppy.

pgsql: Further refactoring of c.h and nearby files.

2017-11-16 Thread Tom Lane
Further refactoring of c.h and nearby files. This continues the work of commit 91aec93e6 by getting rid of a lot of Windows-specific funny business in "section 0". Instead of including pg_config_os.h in different places depending on platform, let's standardize on putting it before the system

pgsql: Prevent to_number() from losing data when template doesn't match

2017-11-17 Thread Tom Lane
Prevent to_number() from losing data when template doesn't match exactly. Non-data template patterns would consume characters whether or not those characters were what the pattern expected, for example SELECT TO_NUMBER('1234', '9,999'); produced 134 because the '2' got eaten by the comma

pgsql: Provide modern examples of how to auto-start Postgres on macOS.

2017-11-17 Thread Tom Lane
Provide modern examples of how to auto-start Postgres on macOS. The scripts in contrib/start-scripts/osx don't work at all on macOS 10.10 (Yosemite) or later, because they depend on SystemStarter which Apple deprecated long ago and removed in 10.10. Add a new subdirectory

pgsql: Provide modern examples of how to auto-start Postgres on macOS.

2017-11-17 Thread Tom Lane
Provide modern examples of how to auto-start Postgres on macOS. The scripts in contrib/start-scripts/osx don't work at all on macOS 10.10 (Yosemite) or later, because they depend on SystemStarter which Apple deprecated long ago and removed in 10.10. Add a new subdirectory

pgsql: Provide modern examples of how to auto-start Postgres on macOS.

2017-11-17 Thread Tom Lane
Provide modern examples of how to auto-start Postgres on macOS. The scripts in contrib/start-scripts/osx don't work at all on macOS 10.10 (Yosemite) or later, because they depend on SystemStarter which Apple deprecated long ago and removed in 10.10. Add a new subdirectory

pgsql: Provide modern examples of how to auto-start Postgres on macOS.

2017-11-17 Thread Tom Lane
Provide modern examples of how to auto-start Postgres on macOS. The scripts in contrib/start-scripts/osx don't work at all on macOS 10.10 (Yosemite) or later, because they depend on SystemStarter which Apple deprecated long ago and removed in 10.10. Add a new subdirectory

Re: pgsql: Remove BufFile's isTemp flag.

2017-11-17 Thread Tom Lane
I wrote: > Andres Freund <and...@anarazel.de> writes: >> On 2017-11-16 21:58:14 -0500, Tom Lane wrote: >>> [ squint... ] That used to have an actual purpose connected to >>> transaction-abort cleanup, IIRC. It disturbs me that this seems >>> to have

pgsql: Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD

2017-11-20 Thread Tom Lane
Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD. David Carlier (from a patch being carried by OpenBSD packagers) Discussion: https://postgr.es/m/ca+xhmqzwfsgvu7menfhcecc8ydp98tigxzzpd0aadwagwav...@mail.gmail.com Branch -- master Details ---

pgsql: Add support for Motorola 88K to s_lock.h.

2017-11-20 Thread Tom Lane
Add support for Motorola 88K to s_lock.h. Apparently there are still people out there who care about this old architecture. They probably care about dusty versions of Postgres too, so back-patch to all supported branches. David Carlier (from a patch being carried by OpenBSD packagers)

pgsql: Add support for Motorola 88K to s_lock.h.

2017-11-20 Thread Tom Lane
Add support for Motorola 88K to s_lock.h. Apparently there are still people out there who care about this old architecture. They probably care about dusty versions of Postgres too, so back-patch to all supported branches. David Carlier (from a patch being carried by OpenBSD packagers)

pgsql: Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD

2017-11-20 Thread Tom Lane
Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD. David Carlier (from a patch being carried by OpenBSD packagers) Discussion: https://postgr.es/m/ca+xhmqzwfsgvu7menfhcecc8ydp98tigxzzpd0aadwagwav...@mail.gmail.com Branch -- REL9_4_STABLE Details ---

pgsql: Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD

2017-11-20 Thread Tom Lane
Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD. David Carlier (from a patch being carried by OpenBSD packagers) Discussion: https://postgr.es/m/ca+xhmqzwfsgvu7menfhcecc8ydp98tigxzzpd0aadwagwav...@mail.gmail.com Branch -- REL9_3_STABLE Details ---

pgsql: Add support for Motorola 88K to s_lock.h.

2017-11-20 Thread Tom Lane
Add support for Motorola 88K to s_lock.h. Apparently there are still people out there who care about this old architecture. They probably care about dusty versions of Postgres too, so back-patch to all supported branches. David Carlier (from a patch being carried by OpenBSD packagers)

pgsql: Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD

2017-11-20 Thread Tom Lane
Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD. David Carlier (from a patch being carried by OpenBSD packagers) Discussion: https://postgr.es/m/ca+xhmqzwfsgvu7menfhcecc8ydp98tigxzzpd0aadwagwav...@mail.gmail.com Branch -- REL9_5_STABLE Details ---

pgsql: Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD

2017-11-20 Thread Tom Lane
Use out-of-line M68K spinlock code for OpenBSD as well as NetBSD. David Carlier (from a patch being carried by OpenBSD packagers) Discussion: https://postgr.es/m/ca+xhmqzwfsgvu7menfhcecc8ydp98tigxzzpd0aadwagwav...@mail.gmail.com Branch -- REL_10_STABLE Details ---

pgsql: Add support for Motorola 88K to s_lock.h.

2017-11-20 Thread Tom Lane
Add support for Motorola 88K to s_lock.h. Apparently there are still people out there who care about this old architecture. They probably care about dusty versions of Postgres too, so back-patch to all supported branches. David Carlier (from a patch being carried by OpenBSD packagers)

pgsql: Support index-only scans in contrib/cube and contrib/seg GiST in

2017-11-20 Thread Tom Lane
Support index-only scans in contrib/cube and contrib/seg GiST indexes. To do this, we only have to remove the compress and decompress support functions, which have never done anything more than detoasting. In the wake of commit d3a4f89d8, this results in automatically enabling index-only scans,

pgsql: Fix compiler warning in rangetypes_spgist.c.

2017-11-18 Thread Tom Lane
Fix compiler warning in rangetypes_spgist.c. On gcc 7.2.0, comparing pointer to (Datum) 0 produces a warning. Treat it as a simple pointer to avoid that; this is more consistent with comparable code elsewhere, anyway. Tomas Vondra Discussion:

pgsql: Fix compiler warning in rangetypes_spgist.c.

2017-11-18 Thread Tom Lane
Fix compiler warning in rangetypes_spgist.c. On gcc 7.2.0, comparing pointer to (Datum) 0 produces a warning. Treat it as a simple pointer to avoid that; this is more consistent with comparable code elsewhere, anyway. Tomas Vondra Discussion:

pgsql: Merge near-duplicate code in RI triggers.

2017-11-18 Thread Tom Lane
Merge near-duplicate code in RI triggers. Merge ri_restrict_del and ri_restrict_upd into one function ri_restrict. Create a function ri_setnull that is the common implementation of RI_FKey_setnull_del and RI_FKey_setnull_upd. Likewise create a function ri_setdefault that is the common

Re: pgsql: Remove BufFile's isTemp flag.

2017-11-19 Thread Tom Lane
Thomas Munro <thomas.mu...@enterprisedb.com> writes: >> On 2017-11-17 11:23:54 -0500, Tom Lane wrote: >>> I wonder whether we should then rename BufFileCreateTemp to just >>> BufFileCreate, since it's no longer possible to have a BufFile that >>> isn't

Re: pgsql: Parameter toast_tuple_target controls TOAST for new rows

2017-11-19 Thread Tom Lane
whether the feature does what it's supposed to. (Also, scaling the results to blocksize seems unlikely to help in passing on different BLCKSZ configurations...) regards, tom lane

Re: pgsql: Parameter toast_tuple_target controls TOAST for new rows

2017-11-19 Thread Tom Lane
Andres Freund <and...@anarazel.de> writes: > On 2017-11-19 19:49:01 -0500, Tom Lane wrote: >> TBH, I would just remove those test cases. Even if they were stable >> across platforms, they don't directly prove anything at all about >> whether the feature does what i

pgsql: Improve to_date/to_number/to_timestamp behavior with multibyte c

2017-11-18 Thread Tom Lane
Improve to_date/to_number/to_timestamp behavior with multibyte characters. The documentation says that these functions skip one input character per literal (non-pattern) format character. Actually, though, they skipped one input *byte* per literal *byte*, which could be hugely confusing if

pgsql: Doc: fix broken markup.

2017-11-21 Thread Tom Lane
Doc: fix broken markup. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/41761265e88f09fba4028352b8e2be82d049cedc Modified Files -- doc/src/sgml/ref/create_table.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: pgsql: Remove BufFile's isTemp flag.

2017-11-16 Thread Tom Lane
purpose connected to transaction-abort cleanup, IIRC. It disturbs me that this seems to have been lost. regards, tom lane

Re: pgsql: Remove BufFile's isTemp flag.

2017-11-16 Thread Tom Lane
Andres Freund <and...@anarazel.de> writes: > On 2017-11-16 21:58:14 -0500, Tom Lane wrote: >> [ squint... ] That used to have an actual purpose connected to >> transaction-abort cleanup, IIRC. It disturbs me that this seems >> to have been lost. > I've not found a

pgsql: Allow running just selected steps of pgbench's initialization se

2017-11-13 Thread Tom Lane
Allow running just selected steps of pgbench's initialization sequence. This feature caters to specialized use-cases such as running the normal pgbench scenario with nonstandard indexes, or inserting other actions between steps of the initialization sequence. The normal sequence of

Re: pgsql: PL/Python: Fix potential NULL pointer dereference

2017-12-05 Thread Tom Lane
need a comment explaining why it's like that, though. regards, tom lane

pgsql: In plpgsql, unify duplicate variables for record and row cases.

2017-12-08 Thread Tom Lane
In plpgsql, unify duplicate variables for record and row cases. plpgsql's function exec_move_row() handles assignment of a composite source value to either a PLpgSQL_rec or PLpgSQL_row target variable. Oddly, rather than taking a single target argument which it could do run-time type detection

Re: pgsql: Support Parallel Append plan nodes.

2017-12-05 Thread Tom Lane
ared for the possibility that first_partial_plan >= node->as_nplans, I'm not sure why this code supposes that that can't happen. BTW, I find it confusing and bad style that some of the references in this function to node->as_pstate go through the local variable pstate but others do not. regards, tom lane

Re: pgsql: Support Parallel Append plan nodes.

2017-12-05 Thread Tom Lane
mething. This doesn't give me a warm fuzzy feeling about how much testing this patch has gotten. regards, tom lane diff --git a/src/backend/executor/nodeAppend.c b/src/backend/executor/nodeAppend.c index 246a0b2..4c4355b 100644 --- a/src/backend/executor/nodeAppend.c

pgsql: Adjust regression test cases added by commit ab7271677.

2017-12-05 Thread Tom Lane
Adjust regression test cases added by commit ab7271677. I suppose it is a copy-and-paste error that this test doesn't actually test the "Parallel Append with both partial and non-partial subplans" case (EXPLAIN alone surely doesn't qualify as a test of executor behavior). Fix that. Also, add

pgsql: Fix corner-case coredump in _SPI_error_callback().

2017-12-11 Thread Tom Lane
Fix corner-case coredump in _SPI_error_callback(). I noticed that _SPI_execute_plan initially sets spierrcontext.arg = NULL, and only fills it in some time later. If an error were to happen in between, _SPI_error_callback would try to dereference the null pointer. This is unlikely --- there's

pgsql: Fix corner-case coredump in _SPI_error_callback().

2017-12-11 Thread Tom Lane
Fix corner-case coredump in _SPI_error_callback(). I noticed that _SPI_execute_plan initially sets spierrcontext.arg = NULL, and only fills it in some time later. If an error were to happen in between, _SPI_error_callback would try to dereference the null pointer. This is unlikely --- there's

pgsql: Fix corner-case coredump in _SPI_error_callback().

2017-12-11 Thread Tom Lane
Fix corner-case coredump in _SPI_error_callback(). I noticed that _SPI_execute_plan initially sets spierrcontext.arg = NULL, and only fills it in some time later. If an error were to happen in between, _SPI_error_callback would try to dereference the null pointer. This is unlikely --- there's

pgsql: Fix corner-case coredump in _SPI_error_callback().

2017-12-11 Thread Tom Lane
Fix corner-case coredump in _SPI_error_callback(). I noticed that _SPI_execute_plan initially sets spierrcontext.arg = NULL, and only fills it in some time later. If an error were to happen in between, _SPI_error_callback would try to dereference the null pointer. This is unlikely --- there's

Re: pgsql: When VACUUM or ANALYZE skips a concurrently dropped table, log i

2017-12-06 Thread Tom Lane
ationtester.c's hardwired one-minute timeout to trigger. While you could imagine doing something to get around that, I do not believe that this test is worth memorializing in perpetuity to begin with. I'd recommend just taking it out again. regards, tom lane

pgsql: Fix plpgsql to reinitialize record variables at block re-entry.

2017-12-09 Thread Tom Lane
Fix plpgsql to reinitialize record variables at block re-entry. If one exits and re-enters a DECLARE ... BEGIN ... END block within a single execution of a plpgsql function, perhaps due to a surrounding loop, the declared variables are supposed to get re-initialized to null (or whatever their

pgsql: Stabilize output of new regression test case.

2017-12-10 Thread Tom Lane
Stabilize output of new regression test case. The test added by commit 390d58135 turns out to have different output in CLOBBER_CACHE_ALWAYS builds: there's an extra CONTEXT line in the error message as a result of detecting the error at a different place. Possibly we should do something to make

pgsql: Fix uninitialized-variable compiler warning induced by commit e4

2017-12-03 Thread Tom Lane
Fix uninitialized-variable compiler warning induced by commit e4128ee76. I'm a little bit astonished that anyone's compiler would have failed to complain about this. The compiler surely does not know that is_procedure means the function return value will be ignored. Branch -- master

pgsql: Support boolean columns in functional-dependency statistics.

2017-12-04 Thread Tom Lane
Support boolean columns in functional-dependency statistics. There's no good reason that the multicolumn stats stuff shouldn't work on booleans. But it looked only for "Var = pseudoconstant" clauses, and it will seldom find those for boolean Vars, since earlier phases of planning will fold

Re: pgsql: Support Parallel Append plan nodes.

2017-12-06 Thread Tom Lane
an we do something with Andres' suggestion of running these test cases under parallel_leader_participation = off? regards, tom lane

pgsql: Sync our copy of the timezone library with IANA release tzcode20

2018-05-04 Thread Tom Lane
Sync our copy of the timezone library with IANA release tzcode2018e. The non-cosmetic changes involve teaching the "zic" tzdata compiler about negative DST. While I'm not currently intending that we start using negative-DST data right away, it seems possible that somebody would try to use our

  1   2   3   4   5   6   7   8   9   10   >