SET TRANSACTION in PL/pgSQL

2018-02-28 Thread Peter Eisentraut
Currently, you can't run SET TRANSACTION in PL/pgSQL. A normal SQL command run inside PL/pgSQL acquires a snapshot, but SET TRANSACTION does not work anymore if a snapshot is set. Here is a patch to work around that by handling this command separately. I have coded this here bypassing SPI

PATCH: Unlogged tables re-initialization tests

2018-02-28 Thread David Steele
These tests were originally included in the exclude unlogged tables patch [1] to provide coverage for the refactoring of reinit.c. After review we found a simpler implementation that did not require the reinit.c refactor so I dropped the tests from that patch. I did not include the refactor here

2018-03 Commitfest starts tomorrow

2018-02-28 Thread David Steele
Hackers! I'll be starting the Commitfest at midnight AoE (07:00 ET, 13:00 CET) so please get your patches in before then. Please remember that if you drop a new and large (or invasive patch) into this CF it may be moved to the next CF. This last CF for PG11 should generally be restricted to

Re: Online enabling of checksums

2018-02-28 Thread Tomas Vondra
On 02/28/2018 08:42 PM, Alvaro Herrera wrote: > I noticed that pg_verify_checksum takes an "-o oid" argument to only > check the relation with that OID; but that's wrong, because the number > is a relfilenode, not an OID (since it's compared to the on-disk file > name). I would suggest changing

Re: [PATCH] Verify Checksums during Basebackups

2018-02-28 Thread David Steele
On 2/28/18 1:08 PM, Michael Banck wrote: > > The attached small patch verifies checksums (in case they are enabled) > during a basebackup. The rationale is that we are reading every block in > this case anyway, so this is a good opportunity to check them as well. > Other and complementary ways of

Re: [HACKERS] MERGE SQL Statement for PG11

2018-02-28 Thread Peter Geoghegan
On Wed, Feb 28, 2018 at 8:53 AM, Robert Haas wrote: > On Tue, Feb 27, 2018 at 5:07 PM, Peter Geoghegan wrote: >> I now feel like Simon's suggestion of throwing an error in corner >> cases isn't so bad. It still seems like we could do better, but the >> more I

Re: handling of heap rewrites in logical decoding

2018-02-28 Thread Peter Eisentraut
On 2/25/18 07:27, Craig Ringer wrote: > I'm pretty sure we _will_ want the ability to decode and stream rewrite > contents for non-IMMUTABLE table rewrites. > > Filtering out by default is OK by me, but I think making it impossible > to decode is a mistake. So I'm all for the oid option and had

PL/pgSQL nested CALL with transactions

2018-02-28 Thread Peter Eisentraut
So far, a nested CALL or DO in PL/pgSQL would not establish a context where transaction control statements were allowed. This patch fixes that by handling CALL and DO specially in PL/pgSQL, passing the atomic/nonatomic execution context through and doing the required management around transaction

[PATCH] Verify Checksums during Basebackups

2018-02-28 Thread Michael Banck
Hi, some installations have data which is only rarerly read, and if they are so large that dumps are not routinely taken, data corruption would only be detected with some large delay even with checksums enabled. The attached small patch verifies checksums (in case they are enabled) during a

Re: Server won't start with fallback setting by initdb.

2018-02-28 Thread Robert Haas
On Fri, Feb 9, 2018 at 3:08 AM, Kyotaro HORIGUCHI wrote: > I'm not sure such a case happens in the real world nowadays, > initdb uses the fallback value of max_connections=10. But it is > out of favor of server since it is not larger than > max_wal_senders(10). >

Re: [HACKERS] Cast jsonb to numeric, int, float, bool

2018-02-28 Thread Anastasia Lubennikova
01.02.2017 17:41, Anastasia Lubennikova: Now the simplest way to extract booleans and numbers from json/jsonb is to cast it to text and then cast to the appropriate type: postgres=# select 'true'::jsonb::text::bool;  bool --  t postgres=# select '1.0'::jsonb::text::numeric;  numeric

Re: Online enabling of checksums

2018-02-28 Thread Alvaro Herrera
I noticed that pg_verify_checksum takes an "-o oid" argument to only check the relation with that OID; but that's wrong, because the number is a relfilenode, not an OID (since it's compared to the on-disk file name). I would suggest changing everything to clarify that it's a pg_class.relfilenode

Re: Cast jsonb to numeric, int, float, bool

2018-02-28 Thread Darafei Praliaskouski
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested We're using this patch and like it a lot. We store a lot of

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Peter Eisentraut
On 2/28/18 16:43, Andres Freund wrote: > a significant number of times during investigations of bugs I wondered > whether running the cluster with various settings, or various tools > could've caused the issue at hand. Therefore I'd like to propose adding > a 'tainted' field to pg_control, that

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Tomas Vondra
On 02/28/2018 10:43 PM, Andres Freund wrote: > Hi, > > a significant number of times during investigations of bugs I wondered > whether running the cluster with various settings, or various tools > could've caused the issue at hand. Therefore I'd like to propose adding > a 'tainted' field to

Re: [HACKERS] MERGE SQL Statement for PG11

2018-02-28 Thread Peter Geoghegan
On Fri, Feb 9, 2018 at 6:36 AM, Robert Haas wrote: > Here's my $0.02: I think that new concurrency errors thrown by the > merge code itself deserve strict scrutiny and can survive only if they > have a compelling justification, but if the merge code happens to > choose an

Re: Missing comment edit

2018-02-28 Thread Tom Lane
Kyotaro HORIGUCHI writes: > I happend to find that the comment on formdesc is missing > pg_subscription. Please find the attached patch (I'm sure:) to > fix that . Hmm ... certainly, that comment is now wrong, but I'm kind of inclined to just remove it, because

Re: IndexTupleDSize macro seems redundant

2018-02-28 Thread Tom Lane
Stephen Frost writes: > Updated (combined) patch attached for review. I went through and looked > again to make sure there weren't any cases of making an unaligned > pointer to a struct and didn't see any, and I added some comments to > _bt_restore_page(). This seems to have

Re: row filtering for logical replication

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 07:03, Euler Taveira wrote: > Hi, > > The attached patches add support for filtering rows in the publisher. > The output plugin will do the work if a filter was defined in CREATE > PUBLICATION command. An optional WHERE clause can be added after the >

RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Andres Freund
Hi, a significant number of times during investigations of bugs I wondered whether running the cluster with various settings, or various tools could've caused the issue at hand. Therefore I'd like to propose adding a 'tainted' field to pg_control, that contains some of the "history" of the

Re: Two small patches for the isolationtester lexer

2018-02-28 Thread Tom Lane
Daniel Gustafsson writes: >> On 22 Feb 2018, at 05:12, Tom Lane wrote: >> Another idea is just to teach addlitchar to realloc the buffer bigger >> when necessary. > I think this is the best approach for the task, the attached patch changes the > static

Re: prokind column (was Re: [HACKERS] SQL procedures)

2018-02-28 Thread Michael Paquier
On Wed, Feb 28, 2018 at 05:37:11PM -0500, Peter Eisentraut wrote: > On 2/28/18 15:45, Tom Lane wrote: >> I have reviewed this patch and attach an updated version below. >> I've rebased it up to today, fixed a few minor errors, and adopted >> most of Michael's suggestions. Also, since I remain

INOUT parameters in procedures

2018-02-28 Thread Peter Eisentraut
This patch set adds support for INOUT parameters to procedures. Currently, INOUT and OUT parameters are not supported. A top-level CALL returns the output parameters as a result row. In PL/pgSQL, I have added special support to pass the output back into the variables, as one would expect. These

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Justin Pryzby
On Wed, Feb 28, 2018 at 02:18:12PM -0800, Andres Freund wrote: > On 2018-02-28 17:14:18 -0500, Peter Eisentraut wrote: > > I can see why you'd want that, but as a DBA, I don't necessarily want > > all of that recorded, especially in a quasi-permanent way. > > Huh? You're arguing that we should

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-02-28 Thread Nikita Glukhov
Attached 3rd version of kNN for SP-GiST. On 09.03.2017 16:52, Alexander Korotkov wrote: Hi, Nikita! I take a look to this patchset.  My first notes are following. * 0003-Extract-index_store_orderby_distances-v02.patch Function index_store_orderby_distances doesn't look general enough for

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Andres Freund
Hi, On 2018-02-28 17:14:18 -0500, Peter Eisentraut wrote: > I can see why you'd want that, but as a DBA, I don't necessarily want > all of that recorded, especially in a quasi-permanent way. Huh? You're arguing that we should make it easier for DBAs to hide potential causes of corruption? I

Re: ON CONFLICT DO UPDATE for partitioned tables

2018-02-28 Thread Amit Langote
On 2018/03/01 1:03, Robert Haas wrote: > On Tue, Feb 27, 2018 at 7:46 PM, Alvaro Herrera > wrote: >> I updated Amit Langote's patch for INSERT ON CONFLICT DO UPDATE[1]. >> Following the lead of edd44738bc88 ("Be lazier about partition tuple >> routing.") this incarnation

Re: Two small patches for the isolationtester lexer

2018-02-28 Thread Tom Lane
Daniel Gustafsson writes: > On 22 Feb 2018, at 05:10, Tom Lane wrote: >> Actually, looking closer, this would also trigger on '#' used inside a >> SQL literal, which seems to move the problem cases into the "pretty >> likely" category instead of the

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Justin Pryzby
On Wed, Feb 28, 2018 at 01:43:11PM -0800, Andres Freund wrote: > a significant number of times during investigations of bugs I wondered > whether running the cluster with various settings, or various tools > could've caused the issue at hand. Therefore I'd like to propose adding > a 'tainted'

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Andres Freund
On 2018-02-28 23:13:44 +0100, Tomas Vondra wrote: > > On 02/28/2018 10:43 PM, Andres Freund wrote: > > Hi, > > > > a significant number of times during investigations of bugs I wondered > > whether running the cluster with various settings, or various tools > > could've caused the issue at hand.

Re: prokind column (was Re: [HACKERS] SQL procedures)

2018-02-28 Thread Peter Eisentraut
On 2/28/18 15:45, Tom Lane wrote: > I have reviewed this patch and attach an updated version below. > I've rebased it up to today, fixed a few minor errors, and adopted > most of Michael's suggestions. Also, since I remain desperately > unhappy with putting zeroes into prorettype, I changed it to

VPATH build from a tarball fails with some gmake versions

2018-02-28 Thread Tom Lane
I tried doing a VPATH build referencing a source directory that I'd distclean'd but not maintainer-clean'd, which should simulate the case of a VPATH build from a tarball. I was quite surprised that it fell over: ... gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement

Re: compress method for spgist - 2

2018-02-28 Thread Tom Lane
Alexander Korotkov writes: > On Thu, Jan 4, 2018 at 1:17 AM, Dagfinn Ilmari Mannsåker > wrote: >> This patch added two copies of the poly_ops row to the "Built-in SP-GiST >> Operator Classes" table in spgist.sgml. > Thank for fixing this! I'm sure

Re: VPATH build from a tarball fails with some gmake versions

2018-02-28 Thread Andrew Dunstan
On Thu, Mar 1, 2018 at 9:24 AM, Tom Lane wrote: > I tried doing a VPATH build referencing a source directory that I'd > distclean'd > but not maintainer-clean'd, which should simulate the case of a VPATH > build from a tarball. I was quite surprised that it fell over: > >

Re: Two small patches for the isolationtester lexer

2018-02-28 Thread Daniel Gustafsson
> On 01 Mar 2018, at 06:01, Tom Lane wrote: > Daniel Gustafsson writes: >> I agree, patch 0002 was broken and the correct fix is a much bigger project - >> one too big for me to tackle right now (but hopefully at some point in the >> near >> future).

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Andres Freund
Hi, On 2018-02-28 16:16:53 -0600, Justin Pryzby wrote: Unfortunately your list seems to raise the bar to a place I don't see us going soon :( > - pg_control versions used on this cluster (hopefully a full list..obviously >not going back before PG11); That needs arbitrary much space,

unused includes in test_decoding

2018-02-28 Thread Euler Taveira
Hi, This is a cosmetic patch that removes some unused includes in test_decoding. It seems to be like this since day 1 (9.4). -- Euler Taveira Timbira - http://www.timbira.com.br/ PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento From

row filtering for logical replication

2018-02-28 Thread Euler Taveira
Hi, The attached patches add support for filtering rows in the publisher. The output plugin will do the work if a filter was defined in CREATE PUBLICATION command. An optional WHERE clause can be added after the table name in the CREATE PUBLICATION such as: CREATE PUBLICATION foo FOR TABLE

Re: [HACKERS] pgbench randomness initialization

2018-02-28 Thread Tom Lane
Fabien COELHO writes: >> This is a simple patch that does what it says on the tin. I ran into >> trouble with the pgbench TAP test *even before applying the patch*, but >> only because I was doing a VPATH build as a user without 'write' >> on the source tree

Re: Cast jsonb to numeric, int, float, bool

2018-02-28 Thread Nikita Glukhov
On 01.03.2018 00:43, Darafei Praliaskouski wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested We're using

Re: row filtering for logical replication

2018-02-28 Thread David Fetter
On Wed, Feb 28, 2018 at 08:03:02PM -0300, Euler Taveira wrote: > Hi, > > The attached patches add support for filtering rows in the publisher. > The output plugin will do the work if a filter was defined in CREATE > PUBLICATION command. An optional WHERE clause can be added after the > table name

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 05:43, Andres Freund wrote: > Hi, > > a significant number of times during investigations of bugs I wondered > whether running the cluster with various settings, or various tools > could've caused the issue at hand. Therefore I'd like to propose adding > a

Re: Online enabling of checksums

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 03:42, Alvaro Herrera wrote: > I noticed that pg_verify_checksum takes an "-o oid" argument to only > check the relation with that OID; but that's wrong, because the number > is a relfilenode, not an OID (since it's compared to the on-disk file >

Re: [HACKERS] path toward faster partition pruning

2018-02-28 Thread Amit Langote
On 2018/02/28 19:14, Ashutosh Bapat wrote: > On Wed, Feb 28, 2018 at 6:42 AM, Amit Langote wrote: >> BTW, should there be a relevant test in partition_join.sql? If yes, >> attached a patch (partitionwise-join-collation-test-1.patch) to add one. > > A partition-wise join path will be created but

Re: [bug fix] pg_rewind creates corrupt WAL files, and the standby cannot catch up the primary

2018-02-28 Thread Michael Paquier
On Thu, Mar 01, 2018 at 01:26:32AM +, Tsunakawa, Takayuki wrote: > BTW, should pg_rewind really copy WAL files from the primary? If the > sole purpose of pg_rewind is to recover an instance to use as a > standby, can pg_rewind just remove all WAL files in the target > directory, because the

Re: [HACKERS] path toward faster partition pruning

2018-02-28 Thread Ashutosh Bapat
On Thu, Mar 1, 2018 at 6:57 AM, Amit Langote wrote: > On 2018/02/28 19:14, Ashutosh Bapat wrote: >> On Wed, Feb 28, 2018 at 6:42 AM, Amit Langote wrote: >>> BTW, should there be a relevant test in partition_join.sql? If yes, >>> attached a patch

Re: Why chain of snapshots is used in ReorderBufferCommit?

2018-02-28 Thread Andres Freund
Hi, On 2018-03-01 08:17:33 +0300, Arseny Sher wrote: > While prowling through snapbuild & reorderbuffer code, I wondered: why a queue > of snapshots is used for replaying each transaction instead of just picking up > snapshot from snapbuilder once when COMMIT record is read? I am not aware of >

Re: PATCH: Unlogged tables re-initialization tests

2018-02-28 Thread Thomas Munro
On Thu, Mar 1, 2018 at 9:24 AM, David Steele wrote: > These tests were originally included in the exclude unlogged tables > patch [1] to provide coverage for the refactoring of reinit.c. Hi David, +# The following tests test symlinks. Windows doesn't have symlinks, so +#

Re: CALL optional in PL/pgSQL

2018-02-28 Thread Pavel Stehule
2018-03-01 5:51 GMT+01:00 Peter Eisentraut : > This seems to be a popular issue when porting from PL/SQL, so I'll throw > it out here for discussion. Apparently, in PL/SQL you can call another > procedure without the CALL keyword. Here is a patch that attempts

faster testing with symlink installs

2018-02-28 Thread Peter Eisentraut
I'm proposing a way to make test runs a bit faster. A fair amount of time is taken by creating the test installation. Not huge compared to the whole test run, but still long enough to get boring. The idea (that I stole from somewhere else) is that we make the installation as symlinks pointing

Re: Online enabling of checksums

2018-02-28 Thread Andrey Borodin
> 28 февр. 2018 г., в 22:06, Robert Haas написал(а): > > On Sun, Feb 25, 2018 at 9:54 AM, Magnus Hagander wrote: >> Also if that wasn't clear -- we only do the full page write if there isn't >> already a checksum on the page and that checksum is

Re: CALL optional in PL/pgSQL

2018-02-28 Thread David G. Johnston
On Wednesday, February 28, 2018, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > > > I seem to recall that there were past discussions about this, with > respect to the PERFORM command, but I couldn't find them anymore. > I'm thinking you are thinking of this one.

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 09:00, Justin Pryzby wrote: > > > > - started in single user mode or with system indices disabled? > > why? > > Some of these I suggested just as a datapoint (or other brainstorms I > couldn't > immediately reject). A cluster where someone has UPDATED

[bug fix] pg_rewind creates corrupt WAL files, and the standby cannot catch up the primary

2018-02-28 Thread Tsunakawa, Takayuki
Hello, Our customer hit another bug of pg_rewind with PG 9.5. The attached patch fixes this. PROBLEM After a long run of successful pg_rewind, the synchronized standby could not catch up the primary forever, emitting the following message repeatedly:

Synchronous replay take III

2018-02-28 Thread Thomas Munro
Hi hackers, I was pinged off-list by a fellow -hackers denizen interested in the synchronous replay feature and wanting a rebased patch to test. Here it goes, just in time for a Commitfest. Please skip to the bottom of this message for testing notes. In previous threads[1][2][3] I called this

Re: Online enabling of checksums

2018-02-28 Thread Daniel Gustafsson
> On 01 Mar 2018, at 05:07, Tomas Vondra wrote: > > On 02/28/2018 08:42 PM, Alvaro Herrera wrote: >> I noticed that pg_verify_checksum takes an "-o oid" argument to only >> check the relation with that OID; but that's wrong, because the number >> is a relfilenode,

chained transactions

2018-02-28 Thread Peter Eisentraut
This feature is meant to help manage transaction isolation in procedures. I proposed elsewhere a patch that allows running SET TRANSACTION in PL/pgSQL. But if you have complex procedures that commit many times in different branches perhaps, you'd have to do this in every new transaction, which

Re: Synchronous replay take III

2018-02-28 Thread Thomas Munro
On Thu, Mar 1, 2018 at 2:39 PM, Thomas Munro wrote: > I was pinged off-list by a fellow -hackers denizen interested in the > synchronous replay feature and wanting a rebased patch to test. Here > it goes, just in time for a Commitfest. Please skip to the bottom of

Re: server crash in nodeAppend.c

2018-02-28 Thread Rajkumar Raghuwanshi
On Wed, Feb 28, 2018 at 9:29 PM, Robert Haas wrote: > Nice test case. I pushed commit > ce1663cdcdbd9bf15c81570277f70571b3727dd3, including your test case, to > fix this. Thanks Robert for fix and commit. I have reverified commit, this is working fine now. Thanks &

Re: [HACKERS] pgbench randomness initialization

2018-02-28 Thread Fabien COELHO
Hello Tom, Fabien COELHO writes: This is a simple patch that does what it says on the tin. I ran into trouble with the pgbench TAP test *even before applying the patch*, but only because I was doing a VPATH build as a user without 'write' on the source tree

Re: Support for ECDSA & ed25519 digital signatures in pgcrypto?

2018-02-28 Thread Bruce Momjian
On Sun, Feb 4, 2018 at 04:38:24PM +0530, Nilesh Trivedi wrote: > I recently had to build ed25519 digital signature validation in PostgreSQL. > Since pgcrypto doesn't > support these methods, I had to look into PL/Python and PL/v8 based > implementations. The > experience turned out to be very

fixing more format truncation issues

2018-02-28 Thread Peter Eisentraut
In 6275f5d28a1577563f53f2171689d4f890a46881, we fixed warnings from the options -Wformat-overflow and -Wformat-truncation, which are part of -Wall in gcc 7. Here, I propose to dial this up a bit by adding -Wformat-overflow=2 -Wformat-truncation=2, which use some more worst-case approaches for

CALL optional in PL/pgSQL

2018-02-28 Thread Peter Eisentraut
This seems to be a popular issue when porting from PL/SQL, so I'll throw it out here for discussion. Apparently, in PL/SQL you can call another procedure without the CALL keyword. Here is a patch that attempts to implement that in PL/pgSQL as well. It's not very pretty. I seem to recall that

Re: 2018-03 Commitfest starts tomorrow

2018-02-28 Thread Tom Lane
David Steele writes: > I'll be starting the Commitfest at midnight AoE (07:00 ET, 13:00 CET) so > please get your patches in before then. > Please remember that if you drop a new and large (or invasive patch) > into this CF it may be moved to the next CF. > This last CF for

Re: Two-phase update of restart_lsn in LogicalConfirmReceivedLocation

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 13:39, Arseny Sher wrote: > Hello, > > In LogicalConfirmReceivedLocation two fields (data.catalog_xmin and > effective_catalog_xmin) of ReplicationSlot structure are used for > advancing xmin of the slot. This allows to avoid hole when tuples might >

Re: RFC: Add 'taint' field to pg_control.

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 06:28, Justin Pryzby wrote: > On Wed, Feb 28, 2018 at 02:18:12PM -0800, Andres Freund wrote: > > On 2018-02-28 17:14:18 -0500, Peter Eisentraut wrote: > > > I can see why you'd want that, but as a DBA, I don't necessarily want > > > all of that recorded,

Re: [HACKERS] SERIALIZABLE with parallel query

2018-02-28 Thread Thomas Munro
On Mon, Feb 26, 2018 at 6:37 PM, Thomas Munro wrote: > I've now broken it into two patches. Rebased. -- Thomas Munro http://www.enterprisedb.com 0001-Enable-parallel-query-with-SERIALIZABLE-isolatio-v13.patch Description: Binary data

RE: [bug fix] Produce a crash dump before main() on Windows

2018-02-28 Thread Tsunakawa, Takayuki
From: Tsunakawa, Takayuki [mailto:tsunakawa.ta...@jp.fujitsu.com] > Another idea to add to the current patch is to move the call to SetErrorMode() > to the below function, which is called first in main(). How about this? > > void > pgwin32_install_crashdump_handler(void) > { >

Re: Contention preventing locking

2018-02-28 Thread Konstantin Knizhnik
On 28.02.2018 16:32, Amit Kapila wrote: On Mon, Feb 26, 2018 at 8:26 PM, Konstantin Knizhnik wrote: On 26.02.2018 17:20, Amit Kapila wrote: Can you please explain, how it can be done easily without extra tuple locks? I have tried to read your patch but due to

RE: [bug fix] pg_rewind creates corrupt WAL files, and the standby cannot catch up the primary

2018-02-28 Thread Tsunakawa, Takayuki
From: Michael Paquier [mailto:mich...@paquier.xyz] > Yes, it should not copy those WAL files. Most of the time they are going > to be meaningless. See this recent thread: > https://www.postgresql.org/message-id/20180126023609.GH17847%40paquier > .xyz > So I would rather go this way instead of

Re: Online enabling of checksums

2018-02-28 Thread Andrey Borodin
> 28 февр. 2018 г., в 6:22, Daniel Gustafsson написал(а): > >> Is there any way we could provide this functionality for previous versions >> (9.6,10)? Like implement utility for offline checksum enabling, without >> WAL-logging, surely. > > While outside the scope of the

Re: parallel append vs. simple UNION ALL

2018-02-28 Thread Amit Khandekar
> On Sat, Feb 24, 2018 at 2:55 AM, Robert Haas wrote: >> >> 0001 is pretty much the same as the subquery-smarts.patch file I >> attached to the previous email. I don't see much reason not to go >> ahead and commit this, although it could use a test case. It makes >> the

Re: [PROPOSAL] Nepali Snowball dictionary

2018-02-28 Thread Arthur Zakirov
On Tue, Feb 20, 2018 at 12:01:30AM +0300, Arthur Zakirov wrote: > > As best I know, the original list > > http://lists.tartarus.org/mailman/listinfo/snowball-discuss > > is moribund, but there's a fork at > > http://snowballstem.org > > that has at least some activity. > > From the original list

Re: Function to track shmem reinit time

2018-02-28 Thread Grigory Smolkin
It can be used to accurately calculate server uptime, since you can`t rely on pg_postmaster_start_time() in this. On 02/28/2018 03:11 PM, Anastasia Lubennikova wrote: Attached patch introduces a new function pg_shmem_init_time(), which returns the time shared memory was last (re)initialized.

Re: Contention preventing locking

2018-02-28 Thread Amit Kapila
On Mon, Feb 26, 2018 at 8:26 PM, Konstantin Knizhnik wrote: > > On 26.02.2018 17:20, Amit Kapila wrote: >> >> Can you please explain, how it can be done easily without extra tuple >> locks? I have tried to read your patch but due to lack of comments, >> it is not clear

Re: [PoC PATCH] Parallel dump to /dev/null

2018-02-28 Thread Michael Banck
Hi, On Thu, Feb 01, 2018 at 02:24:46PM +0100, Michael Banck wrote: > dumping a database to /dev/null via pg_dump is (AFAIK) one recommended > way to check for corruption. However, dumping to /dev/null is currently > not supported in directory mode which makes it not possible to dump to >

Re: [patch] BUG #15005: ANALYZE can make pg_class.reltuples inaccurate.

2018-02-28 Thread Alexander Kuzmenkov
Hi David, I was able to reproduce the problem using your script. analyze_counts.awk is missing, though. The idea of using the result of ANALYZE as-is, without additional averaging, was discussed when vac_estimate_reltuples() was introduced originally. Ultimately, it was decided not to do

Re: [HACKERS] WIP: long transactions on hot standby feedback replica / proof of concept

2018-02-28 Thread Ivan Kartyshov
Thank you for your valuable comments. I've made a few adjustments. The main goal of my changes is to let long read-only transactions run on replica if hot_standby_feedback is turned on. Patch1 - hsfeedback_av_truncate.patch is made to stop ResolveRecoveryConflictWithLock occurs on replica,

Re: [PATCH] Opclass parameters

2018-02-28 Thread Nikolay Shaplov
В письме от 28 февраля 2018 00:46:36 пользователь Nikita Glukhov написал: > I would like to present patch set implementing opclass parameters. > > This feature was recently presented at pgconf.ru: > http://www.sai.msu.su/~megera/postgres/talks/opclass_pgconf.ru-2018.pdf > > A analogous work was

Re: Reopen logfile on SIGHUP

2018-02-28 Thread Grigory Smolkin
If there is already SIGUSR1 for logfile reopening then shouldn`t postmaster watch for it? Postmaster PID is easy to obtain. On 02/28/2018 01:32 AM, Greg Stark wrote: On 27 February 2018 at 14:41, Anastasia Lubennikova wrote: Small patch in the attachment

Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support

2018-02-28 Thread Peter Eisentraut
On 2/24/18 18:29, Michael Paquier wrote: > Sure. But then I think that it would be nice to show up on screen the > reason why the test failed if possible. As of now if SSL is missing the > whole run shows in red without providing much useful information. > Instead of 0001 as shaped previously,

Re: Incorrect comments in partition.c

2018-02-28 Thread Robert Haas
On Wed, Feb 28, 2018 at 3:24 AM, Etsuro Fujita wrote: > I'll add this to the upcoming commitfest. Committed. Sorry that I didn't notice this thread sooner (and that the original commits didn't take care of it). -- Robert Haas EnterpriseDB:

RE: Direct converting numeric types to bool

2018-02-28 Thread Alex Ignatov
-Original Message- From: n.zhuch...@postgrespro.ru [mailto:n.zhuch...@postgrespro.ru] Sent: Wednesday, February 28, 2018 6:04 PM To: pgsql-hackers Subject: Direct converting numeric types to bool Attached patch allow direct convertion of numeric types to

PATCH: Exclude temp relations from base backup

2018-02-28 Thread David Steele
This is a follow-up patch from the exclude unlogged relations discussion [1]. The patch excludes temporary relations during a base backup using the existing looks_like_temp_rel_name() function for identification. It shares code to identify database directories from [1], so for now that has been

Reduce amount of WAL generated by CREATE INDEX for gist, gin and sp-gist

2018-02-28 Thread Anastasia Lubennikova
Hi, I want to propose a bunch of patches which allow to reduce WAL traffic generated by CREATE INDEX for GiST, GIN and SP-GiST. Similarly to b-tree and RUM, we can now log index pages of other access methods only once in the end of indexbuild process. Implementation is based on generic_xlog.

Direct converting numeric types to bool

2018-02-28 Thread n . zhuchkov
Attached patch allow direct convertion of numeric types to bool like integer::bool. Supported types: - smallint; - bigint; - real; - double precision; - decimal(numeric). This functionality is helped with migration from Oracle. -- Nikita Zhuchkov Postgres Professional:

Re: Direct converting numeric types to bool

2018-02-28 Thread Pavel Stehule
2018-02-28 16:13 GMT+01:00 Pavel Stehule : > Hi > > 2018-02-28 16:06 GMT+01:00 : > >> n.zhuch...@postgrespro.ru писал 2018-02-28 18:04: >> >> Attached patch allow direct convertion of numeric types to bool like >>> integer::bool. >>> Supported

Re: Kerberos test suite

2018-02-28 Thread Peter Eisentraut
On 2/27/18 00:56, Thomas Munro wrote: > FWIW it passes for me if I add this: > > +elsif ($^O eq 'freebsd') > +{ > + $krb5_bin_dir = '/usr/local/bin'; > + $krb5_sbin_dir = '/usr/local/sbin'; I suppose you only need the second one, right? The first one should be in the path. > +} >

Re: server crash in nodeAppend.c

2018-02-28 Thread Robert Haas
On Tue, Feb 27, 2018 at 5:24 AM, Rajkumar Raghuwanshi wrote: > SET parallel_setup_cost=0; > SET parallel_tuple_cost=0; > create or replace function foobar() returns setof text as > $$ select 'foo'::varchar union all select 'bar'::varchar ; $$ > language sql

Re: Direct converting numeric types to bool

2018-02-28 Thread n . zhuchkov
n.zhuch...@postgrespro.ru писал 2018-02-28 18:04: Attached patch allow direct convertion of numeric types to bool like integer::bool. Supported types: - smallint; - bigint; - real; - double precision; - decimal(numeric). This functionality is helped with migration from Oracle. diff --git

Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly

2018-02-28 Thread Robert Haas
On Tue, Feb 27, 2018 at 5:14 PM, Tom Lane wrote: >> I ran the postgres_fdw regression test with no sleep two times in a >> CLOBBER_CACHE_ALWAYS-enabled build, and then the regression test with >> the sleep (60 seconds) two times, but I couldn't reproduce that in both >> cases.

Re: ON CONFLICT DO UPDATE for partitioned tables

2018-02-28 Thread Robert Haas
On Tue, Feb 27, 2018 at 7:46 PM, Alvaro Herrera wrote: > I updated Amit Langote's patch for INSERT ON CONFLICT DO UPDATE[1]. > Following the lead of edd44738bc88 ("Be lazier about partition tuple > routing.") this incarnation only does the necessary push-ups for the >

Re: [HACKERS] [POC] Faster processing at Gather node

2018-02-28 Thread Robert Haas
On Tue, Feb 27, 2018 at 4:06 PM, Andres Freund wrote: >> OK, I'll try to check how feasible that would be. > > cool. It's not too hard, but it doesn't really seem to help, so I'm inclined to leave it alone. To make it work, you need to keep two separate counters in the

Re: Direct converting numeric types to bool

2018-02-28 Thread Tom Lane
n.zhuch...@postgrespro.ru writes: > Attached patch allow direct convertion of numeric types to bool like > integer::bool. > Supported types: > - smallint; > - bigint; > - real; > - double precision; > - decimal(numeric). > This functionality is helped with migration from Oracle. I

Re: Direct converting numeric types to bool

2018-02-28 Thread Pavel Stehule
Hi 2018-02-28 16:06 GMT+01:00 : > n.zhuch...@postgrespro.ru писал 2018-02-28 18:04: > > Attached patch allow direct convertion of numeric types to bool like >> integer::bool. >> Supported types: >> - smallint; >> - bigint; >> - real; >> - double precision; >> -

Re: Let's remove DSM_INPL_NONE.

2018-02-28 Thread Robert Haas
On Tue, Feb 27, 2018 at 11:30 PM, Tom Lane wrote: > I'd be in favor of having some normally-ifdef'd-out facility for causing > failures of this kind. (As I mentioned upthread, I do not think "always > fail" is sufficient.) That's very different from having a user-visible >

Changing the autovacuum launcher scheduling; oldest table first algorithm

2018-02-28 Thread Masahiko Sawada
Hi, I've created the new thread for the changing AV launcher scheduling. The problem of AV launcher scheduling is described on [1] but I summarize it here. If there is even one database that is at risk of wraparound, currently AV launcher selects the database having the oldest datfrozenxid until

Re: ON CONFLICT DO UPDATE for partitioned tables

2018-02-28 Thread Amit Langote
On 2018/02/28 9:46, Alvaro Herrera wrote: > I updated Amit Langote's patch for INSERT ON CONFLICT DO UPDATE[1]. > Following the lead of edd44738bc88 ("Be lazier about partition tuple > routing.") this incarnation only does the necessary push-ups for the > specific partition that needs it, at

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2018-02-28 Thread Etsuro Fujita
(2018/01/18 16:16), Etsuro Fujita wrote: Attached is a rebased patch. I rebased the patch over HEAD and revised comments/docs a little bit. Please find attached a new version of the patch. Best regards, Etsuro Fujita *** a/contrib/postgres_fdw/deparse.c --- b/contrib/postgres_fdw/deparse.c

Re: Incorrect comments in partition.c

2018-02-28 Thread Etsuro Fujita
(2018/01/24 14:44), Etsuro Fujita wrote: > (2018/01/24 13:06), Amit Langote wrote: >> On 2018/01/23 20:43, Etsuro Fujita wrote: >>> Here is a comment for get_qual_for_list in partition.c: >>> >>> * get_qual_for_list >>> * >>> * Returns an implicit-AND list of expressions to use as a

  1   2   >