Re: Getting rid of "tuple concurrently updated" elog()s with concurrent DDLs (at least ALTER TABLE)

2017-12-26 Thread Michael Paquier
On Tue, Dec 26, 2017 at 10:47:59PM -0800, Robert Haas wrote: > On Tue, Dec 26, 2017 at 4:14 AM, Michael Paquier > wrote: >> On Tue, Dec 26, 2017 at 4:30 PM, Andres Freund wrote: >>> You're proposing to lock the entire relation against many forms of

Re: [HACKERS] pow support for pgbench

2017-12-26 Thread Fabien COELHO
Bonjour Michaël, And my 2c on the matter is that switching silently from one version to the other would be unwelcome. The user should be aware if a test is overflowing a number when specifying an integer. This whole integer pow version is becoming unduly complicated and ugly. For me, the

Re: Add hint about replication slots when nearing wraparound

2017-12-26 Thread Feike Steenbergen
On 23 December 2017 at 11:58, Michael Paquier wrote: > On Fri, Dec 22, 2017 at 07:55:19AM +0100, Feike Steenbergen wrote: >> On 21 December 2017 at 05:32, Michael Paquier >> wrote: >> >> > Don't you want to put that in its own block? That's

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-26 Thread Craig Ringer
On 22 December 2017 at 23:19, Maksim Milyutin wrote: > On 22.12.2017 16:56, Craig Ringer wrote: > > On 22 December 2017 at 20:50, Maksim Milyutin > wrote: > >> On 19.12.2017 16:54, Pavel Stehule wrote: >> >> sorry for small offtopic. Can be used this

Re: AS OF queries

2017-12-26 Thread Craig Ringer
On 25 December 2017 at 15:59, Konstantin Knizhnik wrote: > > > On 25.12.2017 06:26, Craig Ringer wrote: > > On 24 December 2017 at 04:53, konstantin knizhnik < > k.knizh...@postgrespro.ru> wrote: > >> >> >> But what if I just forbid to change recent_global_xmin? >> If

Re: Getting rid of "tuple concurrently updated" elog()s with concurrent DDLs (at least ALTER TABLE)

2017-12-26 Thread Robert Haas
On Tue, Dec 26, 2017 at 4:14 AM, Michael Paquier wrote: > On Tue, Dec 26, 2017 at 4:30 PM, Andres Freund wrote: >> You're proposing to lock the entire relation against many forms of >> concurrent DDL, just to get rid of that error? That seems

Re: Should we nonblocking open FIFO files in COPY?

2017-12-26 Thread Robert Haas
On Tue, Dec 26, 2017 at 7:51 PM, Michael Paquier wrote: >> > Hmm. What about the case where we try to open a plain file that's on >> > an inaccessible filesystem, e.g. due to a disk failure? Allowing >> > cancel to work just for FIFOs would be OK, I guess, but

Re: [HACKERS] taking stdbool.h into use

2017-12-26 Thread Michael Paquier
On Tue, Dec 26, 2017 at 02:00:47PM -0500, Peter Eisentraut wrote: > On 12/25/17 00:32, Michael Paquier wrote: > >> So here is a minimal patch set to perhaps wrap this up for the time > >> being. I have added static assertions that check the sizes of > >> GinNullCategory and GinTernaryValue, which

Re: Should we nonblocking open FIFO files in COPY?

2017-12-26 Thread Michael Paquier
On Wed, Dec 27, 2017 at 10:18:03AM +0800, Adam Lee wrote: > On Tue, Dec 26, 2017 at 11:48:58AM -0800, Robert Haas wrote: > > On Thu, Dec 21, 2017 at 10:10 PM, Adam Lee wrote: > > > I have an issue that COPY from a FIFO, which has no writers, could not be > > > canceled, because

Re: [HACKERS] [PATCH] Tap test support for backup with tablespace mapping

2017-12-26 Thread Michael Paquier
On Wed, Dec 27, 2017 at 12:58:28PM +1100, Vaishnavi Prabakaran wrote: > I have added support in Postgres TAP test framework to backup a data > directory with tablespace mapping. Also added support to move the backup > directory contents to standby node, because current option to init the > standby

Re: AS OF queries

2017-12-26 Thread David Fetter
On Tue, Dec 26, 2017 at 03:43:36PM -0700, legrand legrand wrote: > would actual syntax > > WITH old_foo AS > (select * from foo as of '') > select * from foo except select * from old_foo; > > work in replacement for > > select * from foo except select * from foo as old_foo as of ''; > > ? If

Re: [HACKERS] Runtime Partition Pruning

2017-12-26 Thread David Rowley
Hi, Please find attached my 4th version this patch. This is now based on v17 of Amit's faster partition pruning patch [1]. It also now includes Beena's tests which I've done some mostly cosmetic changes to. I've also fixed a few bugs, one in a case where I was not properly handling zero

Re: Should we nonblocking open FIFO files in COPY?

2017-12-26 Thread Adam Lee
On Tue, Dec 26, 2017 at 11:48:58AM -0800, Robert Haas wrote: > On Thu, Dec 21, 2017 at 10:10 PM, Adam Lee wrote: > > I have an issue that COPY from a FIFO, which has no writers, could not be > > canceled, because COPY invokes AllocateFile() -> fopen() -> blocking open(). > >

[HACKERS] [PATCH] Tap test support for backup with tablespace mapping

2017-12-26 Thread Vaishnavi Prabakaran
Hi All, I have added support in Postgres TAP test framework to backup a data directory with tablespace mapping. Also added support to move the backup directory contents to standby node, because current option to init the standby from backup does not support copying softlinks, which is needed when

Re: [HACKERS] replace GrantObjectType with ObjectType

2017-12-26 Thread Michael Paquier
On Tue, Dec 26, 2017 at 02:15:18PM -0500, Peter Eisentraut wrote: > On 12/20/17 22:01, Stephen Frost wrote: > > There's some downsides to this approach though: we do an initial set of > > checks in ExecGrantStmt, but we can't do all of them because we don't > > know if it's a sequence or not, so

Re: [HACKERS] pow support for pgbench

2017-12-26 Thread Michael Paquier
On Tue, Dec 26, 2017 at 11:26:58PM +0100, Fabien COELHO wrote: > > This version looks good to me, except that I wonder if we should try to > > switch to the floating-point version if the integer version would/does > > overflow. > > My 0.02€ is that it is under the user control who provides either

Re: [HACKERS] pow support for pgbench

2017-12-26 Thread Raúl Marín Rodríguez
Hi, I've implemented the overflow checks and made some benchmarks and the ipow() version became slower except with some specific inputs (base 0 for example). It's true that the new auxiliary functions could be optimized, but I don't think it makes sense to keep working on them just to match pow()

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-12-26 Thread Michael Paquier
On Tue, Dec 26, 2017 at 03:28:09PM -0500, Peter Eisentraut wrote: > On 12/22/17 03:10, Michael Paquier wrote: > > Second thoughts on 0002 as there is actually no need to move around > > errorMessage if the PGconn* pointer is saved in the SCRAM status data > > as both are linked. The attached

Re: AS OF queries

2017-12-26 Thread legrand legrand
would actual syntax WITH old_foo AS (select * from foo as of '') select * from foo except select * from old_foo; work in replacement for select * from foo except select * from foo as old_foo as of ''; ? Regards PAscal -- Sent from:

Re: [HACKERS] pow support for pgbench

2017-12-26 Thread Fabien COELHO
Hello Robert, If a double is always returned, I'm wondering whether keeping the ipow version makes much sense: In case of double loss of precision, the precision is lost, too bad, and casting back to int won't bring it back. I've kept it because knowing that both are ints enables not making

Re: AS OF queries

2017-12-26 Thread Jeff Janes
On Thu, Dec 21, 2017 at 6:00 AM, Konstantin Knizhnik < k.knizh...@postgrespro.ru> wrote: > There is still one significant difference of my prototype implementation > with SQL standard: it associates timestamp with select statement, not with > particular table. > It seems to be more difficult to

Re: [HACKERS] LDAPS

2017-12-26 Thread Peter Eisentraut
This patch looks reasonable to me. I have also seen occasional requests for this in the field. If someone could test this on Windows, I think we could move ahead with it. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training &

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-12-26 Thread Peter Eisentraut
On 12/22/17 03:10, Michael Paquier wrote: > On Fri, Dec 22, 2017 at 11:59 AM, Michael Paquier > wrote: >> I have looked at how things could be done in symmetry for both the frontend >> and backend code, and I have produced the attached patch 0002, which >> can be

Re: Should we nonblocking open FIFO files in COPY?

2017-12-26 Thread Robert Haas
On Thu, Dec 21, 2017 at 10:10 PM, Adam Lee wrote: > I have an issue that COPY from a FIFO, which has no writers, could not be > canceled, because COPY invokes AllocateFile() -> fopen() -> blocking open(). Hmm. What about the case where we try to open a plain file that's on an

Re: [HACKERS] pow support for pgbench

2017-12-26 Thread Robert Haas
On Fri, Dec 22, 2017 at 12:46 AM, Raúl Marín Rodríguez wrote: >> If a double is always returned, I'm wondering whether keeping the ipow >> version makes much sense: In case of double loss of precision, the precision >> is lost, too bad, and casting back to int won't bring

Re: [HACKERS] replace GrantObjectType with ObjectType

2017-12-26 Thread Peter Eisentraut
On 12/20/17 22:01, Stephen Frost wrote: > There's some downsides to this approach though: we do an initial set of > checks in ExecGrantStmt, but we can't do all of them because we don't > know if it's a sequence or not, so we end up with some additional > special checks to see if the GRANT is

Re: [HACKERS] taking stdbool.h into use

2017-12-26 Thread Peter Eisentraut
On 12/25/17 00:32, Michael Paquier wrote: >> So here is a minimal patch set to perhaps wrap this up for the time >> being. I have added static assertions that check the sizes of >> GinNullCategory and GinTernaryValue, which I think are the two critical >> places that require compatibility with

Re: [PROPOSAL] Shared Ispell dictionaries

2017-12-26 Thread Alvaro Herrera
Arthur Zakirov wrote: > On Tue, Dec 26, 2017 at 01:55:57PM -0300, Alvaro Herrera wrote: > > So what are you going to use instead? > > [ ... ] > > To allocate IspellDict in this case it is necessary to calculate needed > memory size. I think arrays mentioned above will be built first then >

Re: [PROPOSAL] Shared Ispell dictionaries

2017-12-26 Thread Arthur Zakirov
Thank you for your feedback. On Tue, Dec 26, 2017 at 01:55:57PM -0300, Alvaro Herrera wrote: > So what are you going to use instead? For example, AffixNode and AffixNodeData represent prefix tree of an affix list. They are accessed by Suffix and Prefix pointers of IspellDict struct now. Instead

Re: [PROPOSAL] Shared Ispell dictionaries

2017-12-26 Thread Pavel Stehule
2017-12-26 17:55 GMT+01:00 Alvaro Herrera : > Arthur Zakirov wrote: > > > Implementation > > -- > > > > It is necessary to change all structures related with IspellDict: > > SPNode, AffixNode, AFFIX, CMPDAffix, IspellDict itself. They all > > shouldn't use

Re: General purpose hashing func in pgbench

2017-12-26 Thread Fabien COELHO
Bonjour Daniel, Most "permutation" functions are really cryptographic cyphers which are quite expensive, and require powers of two, which is not what is needed. ISTM that there are some constructs to deal with arbitrary sizes based on cryptographic functions, but that would make it too

Re: Deadlock in multiple CIC.

2017-12-26 Thread Jeff Janes
On Tue, Dec 26, 2017 at 8:31 AM, Alvaro Herrera wrote: > Jeff Janes wrote: > > c3d09b3bd23f5f6 fixed it so concurrent CIC would not deadlock (or at > least > > not as reliably as before) by dropping its own snapshot before waiting > for > > all the other ones to go away.

Re: [PROPOSAL] Shared Ispell dictionaries

2017-12-26 Thread Alvaro Herrera
Arthur Zakirov wrote: > Implementation > -- > > It is necessary to change all structures related with IspellDict: > SPNode, AffixNode, AFFIX, CMPDAffix, IspellDict itself. They all > shouldn't use pointers for this reason. Others are used only during > dictionary building. So what

Re: Deadlock in multiple CIC.

2017-12-26 Thread Alvaro Herrera
Jeff Janes wrote: > c3d09b3bd23f5f6 fixed it so concurrent CIC would not deadlock (or at least > not as reliably as before) by dropping its own snapshot before waiting for > all the other ones to go away. > > With commit 8aa3e47510b969354ea02a, concurrent CREATE INDEX CONCURRENTLY on > different

Re: [HACKERS] static assertions in C++

2017-12-26 Thread Peter Eisentraut
On 12/20/17 10:51, Tom Lane wrote: > Peter Eisentraut writes: >> On 12/20/17 00:57, Tom Lane wrote: >>> I do not have a well-informed opinion on whether >>> #if defined(__cpp_static_assert) && __cpp_static_assert >= 200410 >>> is an appropriate test for

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2017-12-26 Thread Dmitry Dolgov
> On 25 December 2017 at 18:40, Tomas Vondra wrote: > The attached v3 fixes this issue, and also a couple of other thinkos Thank you for the patch, it looks quite interesting. After a quick look at it (mostly the first one so far, but I'm going to continue) I have a

Logical Decoding and HeapTupleSatisfiesVacuum assumptions

2017-12-26 Thread Nikhil Sontakke
Hi, As of today, in the existing code in HeapTupleSatisfiesVacuum, if a row is inserted via an aborted transaction, then it's deemed to be dead immediately and can be cleaned up for re-use by HOT or vacuum, etc. With logical decoding, there might arise a case that such a row, if it belongs to a

Re: Ethiopian calendar year(DATE TYPE) are different from the Gregorian calendar year

2017-12-26 Thread Pavel Stehule
2017-12-26 14:46 GMT+01:00 Lelisa Diriba : > yes it works on my machine,it coverts from Gregorian calendar year to > Ethiopian calendar year. > Swift ,C# & Java languages locally we have app to convert it, but i can't > get it from them,it is as a commercial,Also ORACLE DB

Ethiopian calendar year(DATE TYPE) are different from the Gregorian calendar year

2017-12-26 Thread Lelisa Diriba
yes it works on my machine,it coverts from Gregorian calendar year to Ethiopian calendar year. Swift ,C# & Java languages locally we have app to convert it, but i can't get it from them,it is as a commercial,Also ORACLE DB localize it.Oracle DB also use for commercial, I want to Localize in

Re: [HACKERS] [PATCH] Lockable views

2017-12-26 Thread Michael Paquier
On Tue, Dec 26, 2017 at 06:37:06PM +0900, Yugo Nagata wrote: > I have created a new entry in CF-2017-1 and registered this thread again. Fine for me. Thanks for the update. And I guess that you are planning to send a new version before the beginning of the next commit fest using the feedback

Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers

2017-12-26 Thread Petr Jelinek
On 26/12/17 11:13, Masahiko Sawada wrote: > On Tue, Dec 26, 2017 at 12:49 AM, Petr Jelinek > wrote: > >>> >>> It's not a problem on crash restart because StartupReorderBuffer already >>> does the required delete. >>> >>> ReorderBufferSerializeTXN, which spills the

Re: Getting rid of "tuple concurrently updated" elog()s with concurrent DDLs (at least ALTER TABLE)

2017-12-26 Thread Michael Paquier
On Tue, Dec 26, 2017 at 4:30 PM, Andres Freund wrote: > You're proposing to lock the entire relation against many forms of concurrent > DDL, just to get rid of that error? That seems unacceptable. > Isn't the canonical way to solve this to take object locks? Sure. That's

Re: [HACKERS] Flexible configuration for full-text search

2017-12-26 Thread Aleksandr Parfenov
On Tue, 26 Dec 2017 13:51:03 +0300 Arthur Zakirov wrote: > On Mon, Dec 25, 2017 at 05:15:07PM +0300, Aleksandr Parfenov wrote: > > Is I understood users need to rewrite their configurations if they > use unaccent dictionary, for example. It is not good I think. Users >

Re: [HACKERS] Replication status in logical replication

2017-12-26 Thread Tels
Moin, On Tue, December 26, 2017 5:26 am, Masahiko Sawada wrote: > On Tue, Dec 26, 2017 at 6:19 PM, Tels > wrote: >> Moin, >> >> On Mon, December 25, 2017 7:26 pm, Masahiko Sawada wrote: >>> On Tue, Dec 26, 2017 at 1:10 AM, Petr Jelinek >>>

PathNameCreateTemporaryDir() vs concurrency

2017-12-26 Thread Thomas Munro
Hi hackers, While testing parallel hash join today, I saw a couple of errors like this: 2017-12-26 23:34:37.402 NZDT [13082] ERROR: cannot create temporary subdirectory "base/pgsql_tmp/pgsql_tmp13080.0.sharedfileset": File exists There is a thinko in PathNameCreateTemporaryDir(), a new

Re: General purpose hashing func in pgbench

2017-12-26 Thread Daniel Verite
Fabien COELHO wrote: > Most "permutation" functions are really cryptographic cyphers which are > quite expensive, and require powers of two, which is not what is needed. > ISTM that there are some constructs to deal with arbitrary sizes based on > cryptographic functions, but that

Re: [HACKERS] Flexible configuration for full-text search

2017-12-26 Thread Arthur Zakirov
On Mon, Dec 25, 2017 at 05:15:07PM +0300, Aleksandr Parfenov wrote: > > In the current version of the patch, configurations written in old > syntax are rewritten into the same configuration in the new syntax. > Since new syntax doesn't support a TSL_FILTER, it was removed from the >

Re: [HACKERS] Replication status in logical replication

2017-12-26 Thread Masahiko Sawada
On Tue, Dec 26, 2017 at 6:19 PM, Tels wrote: > Moin, > > On Mon, December 25, 2017 7:26 pm, Masahiko Sawada wrote: >> On Tue, Dec 26, 2017 at 1:10 AM, Petr Jelinek >> wrote: >>> On 21/11/17 22:06, Masahiko Sawada wrote: After

Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers

2017-12-26 Thread Masahiko Sawada
On Tue, Dec 26, 2017 at 12:49 AM, Petr Jelinek wrote: > Hi, > > thanks for writing the patch. > > On 05/12/17 06:58, Craig Ringer wrote: >> Hi all >> >> [...] >>> The cause appears to be that walsender.c's ProcessRepliesIfAny writes a >> LOG for unexpected EOF then

Re: [HACKERS] [PATCH] Lockable views

2017-12-26 Thread Yugo Nagata
On Sat, 23 Dec 2017 09:44:30 +0900 Michael Paquier wrote: > On Fri, Dec 22, 2017 at 04:19:46PM +0900, Yugo Nagata wrote: > > I was busy for and I could not work on this patch. After reading the > > previous discussion, I still think the behavior of this patch would > >

Re: Protect syscache from bloating with negative cache entries

2017-12-26 Thread Kyotaro HORIGUCHI
At Fri, 22 Dec 2017 13:47:16 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20171222.134716.88479707.horiguchi.kyot...@lab.ntt.co.jp> > Anyway, I think we are reached to a consensus that the > time-tick-based expiration is promising. So I'll work on

Re: [HACKERS] Replication status in logical replication

2017-12-26 Thread Tels
Moin, On Mon, December 25, 2017 7:26 pm, Masahiko Sawada wrote: > On Tue, Dec 26, 2017 at 1:10 AM, Petr Jelinek > wrote: >> On 21/11/17 22:06, Masahiko Sawada wrote: >>> >>> After investigation, I found out that my previous patch was wrong >>> direction. I should

Re: Ethiopian calendar year(DATE TYPE) are different from the Gregorian calendar year

2017-12-26 Thread Pavel Stehule
Hi 2017-12-26 8:23 GMT+01:00 Lelisa Diriba : > In Ethiopia the year have 13 months and but in Gregorian calendar the year > have 12 months, > The Ethiopian society's are want to use his Ethiopian calendar year,i have > the algorithm, > but the way i add to the postgresql