Re: [HACKERS] Renaming more clearly SHA functions in pgcrypto/

2016-07-04 Thread Michael Paquier
On Tue, Jul 5, 2016 at 2:09 AM, Alvaro Herrera wrote: > Michael Paquier wrote: >> Hi all, >> (folks interested in that in CC) >> >> While looking at some facility in pgcrypto, I have noticed the stanza >> created by 56f4478 to prevent conflicts with OpenSSL, like that: >> +#define SHA256_Init pg_S

Re: [HACKERS] Declarative partitioning

2016-07-04 Thread Amit Langote
On 2016/07/04 21:31, Ashutosh Bapat wrote: > Hi Amit, > I observed that the ChangeVarNodes call at line 1229 in > get_relation_constraints() (code below) changes the varno in the cached > copy of partition key expression, which is undesirable. The reason for this > seems to be that the RelationGetP

Re: [HACKERS] [CF2016-9] Allow spaces in working path on tap-tests

2016-07-04 Thread Michael Paquier
On Mon, Jul 4, 2016 at 4:44 PM, Michael Paquier wrote: > And as is the command built for zic.exe in Install.pm, no? $target is > normally an absolute path per the call of Install(). Attached is the patch I have in mind. After more investigation zic.exe is indeed broken, $target can be a full path

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Pavel Stehule
2016-07-05 2:39 GMT+02:00 Andreas 'ads' Scherbaum : > On 04.07.2016 18:37, Pavel Stehule wrote: > >> >> I don't know if the name "strict" is best, but the name "validate" is >> not good too. Current to_date does some validations too. >> > > Obviously not enough, because it allows invalid dates. I'

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Pavel Stehule
2016-07-05 4:33 GMT+02:00 David G. Johnston : > On Mon, Jul 4, 2016 at 8:39 PM, Andreas 'ads' Scherbaum < > adsm...@wars-nicht.de> wrote: > >> On 04.07.2016 18:37, Pavel Stehule wrote: >> >>> >>> I don't know if the name "strict" is best, but the name "validate" is >>> not good too. Current to_dat

Re: [HACKERS] to_date_valid()

2016-07-04 Thread David G. Johnston
On Mon, Jul 4, 2016 at 8:39 PM, Andreas 'ads' Scherbaum < adsm...@wars-nicht.de> wrote: > On 04.07.2016 18:37, Pavel Stehule wrote: > >> >> I don't know if the name "strict" is best, but the name "validate" is >> not good too. Current to_date does some validations too. >> > > Obviously not enough,

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Andreas 'ads' Scherbaum
On 04.07.2016 18:37, Pavel Stehule wrote: I don't know if the name "strict" is best, but the name "validate" is not good too. Current to_date does some validations too. Obviously not enough, because it allows invalid dates. I'd say that the current to_date() merely validates the input format

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Andreas Karlsson
On 07/04/2016 10:55 PM, Pavel Stehule wrote: 2016-07-04 22:15 GMT+02:00 Andreas Karlsson mailto:andr...@proxel.se>>: I do not see a clear conclusion in the linked threads. For example Bruce calls it a bug in one of the emails (https://www.postgresql.org/message-id/201107200103.p6K13i

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Pavel Stehule
2016-07-04 22:15 GMT+02:00 Andreas Karlsson : > On 07/03/2016 12:36 PM, Andreas 'ads' Scherbaum wrote: > >> On 03.07.2016 07:05, Jaime Casanova wrote: >> >>> Shouldn't we fix this instead? Sounds like a bug to me. We don't usually >>> want to be bug compatible so it doesn't matter if we break some

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Andreas Karlsson
On 07/03/2016 12:36 PM, Andreas 'ads' Scherbaum wrote: On 03.07.2016 07:05, Jaime Casanova wrote: Shouldn't we fix this instead? Sounds like a bug to me. We don't usually want to be bug compatible so it doesn't matter if we break something. There are previous discussions about such a change, a

Re: [HACKERS] Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]

2016-07-04 Thread Andrew Borodin
Thank you, Alvaro. Yes, now I see. I'll update gistRedoPageUpdateRecord() to work accordingly with patched gistplacetopage(). Also, i've noticed that PageAddItem uses MAXALIGN() macro to calculate tuple size. So, PageIndexTupleOverwrite should behave the same. About PageIndexDeleteNoCompact() in

Re: [HACKERS] Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]

2016-07-04 Thread Alvaro Herrera
Andrew Borodin wrote: > Thank you, Amit. > > Currently, if WAL reconstruct page in another order it won't be a problem. We require that replay of WAL leads to identical bytes than the original. Among other things, this enables use of a tool that verifies that WAL is working correctly simply by c

Re: [HACKERS] Renaming more clearly SHA functions in pgcrypto/

2016-07-04 Thread Alvaro Herrera
Michael Paquier wrote: > Hi all, > (folks interested in that in CC) > > While looking at some facility in pgcrypto, I have noticed the stanza > created by 56f4478 to prevent conflicts with OpenSSL, like that: > +#define SHA256_Init pg_SHA256_Init > +#define SHA256_Update pg_SHA256_Update > > Woul

Re: [HACKERS] Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]

2016-07-04 Thread Andrew Borodin
Thank you, Amit. Currently, if WAL reconstruct page in another order it won't be a problem. How can I check that it works? Would it be sufficient if I kill 9 backend and postmaster after commit and it will start normally executing select queries after restart? I'll make a patch with missing space

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Pavel Stehule
2016-07-04 18:24 GMT+02:00 Andreas 'ads' Scherbaum : > On 04.07.2016 05:51, Pavel Stehule wrote: > >> >> >> 2016-07-04 5:19 GMT+02:00 Pavel Stehule > >: >> >> >> >> 2016-07-04 4:25 GMT+02:00 Craig Ringer > >: >> >> On 3

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Andreas 'ads' Scherbaum
On 04.07.2016 05:51, Pavel Stehule wrote: 2016-07-04 5:19 GMT+02:00 Pavel Stehule mailto:pavel.steh...@gmail.com>>: 2016-07-04 4:25 GMT+02:00 Craig Ringer mailto:cr...@2ndquadrant.com>>: On 3 July 2016 at 09:32, Euler Taveira mailto:eu...@timbira.com.br>> wrote: On

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Andreas 'ads' Scherbaum
On 04.07.2016 16:33, Amit Kapila wrote: On Sun, Jul 3, 2016 at 6:34 AM, Andreas 'ads' Scherbaum wrote: Hello, we have customers complaining that to_date() accepts invalid dates, and returns a different date instead. This is a known issue: http://sql-info.de/postgresql/notes/to_date-to_timest

Re: [HACKERS] oddity in initdb probing of max_connections/shared_buffers

2016-07-04 Thread Tom Lane
Greg Stark writes: > I happened to notice a bit of an inconsistency in the way initdb > probes max_connections and shared_buffers. > This line in the shared_buffers test: > /* Use same amount of memory, independent of BLCKSZ */ > test_buffs = (trial_bufs[i] * 8192) / BLCKSZ; > has no equivalent

Re: [HACKERS] Cluster on NAS and data center.

2016-07-04 Thread Matt Kelly
As someone who has bitten by index corruption due to collation changes between glibc versions that shipped CentOS 6 and CentOS 7, don't even try to do this with anything other than C collation. The default collation _will_ deterministically leave you with a silently corrupt database if you store an

Re: [HACKERS] Cluster on NAS and data center.

2016-07-04 Thread Tom Lane
Craig Ringer writes: > On 4 July 2016 at 17:33, Krzysztof Kaczkowski wrote: >> We know that standard PostgreSQL is not able to use cluster created on >> different OS. We think that recompilation PostgreSQL with some specific >> flags. This should give us compatibility of cluster on different Syst

Re: [HACKERS] to_date_valid()

2016-07-04 Thread Amit Kapila
On Sun, Jul 3, 2016 at 6:34 AM, Andreas 'ads' Scherbaum wrote: > > Hello, > > we have customers complaining that to_date() accepts invalid dates, and > returns a different date instead. This is a known issue: > > http://sql-info.de/postgresql/notes/to_date-to_timestamp-gotchas.html > > On the othe

Re: [HACKERS] Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]

2016-07-04 Thread Amit Kapila
On Mon, Jul 4, 2016 at 4:52 PM, Andrew Borodin wrote: > Here is a patch with corrections from Alexander Korotkov. > My tests, check and check-world show no problems against Ubuntu LTS 14 x64 VM. > > - PageIndexTupleDelete(page, oldoffnum); - gistfillbuffer(page, itup, ntup, InvalidOffsetNumber);

Re: [HACKERS] [PERFORM] 9.4 -> 9.5 regression with queries through pgbouncer on RHEL 6

2016-07-04 Thread Vladimir Borodin
> 13 июня 2016 г., в 21:58, Vladimir Borodin написал(а): > >> >> 13 июня 2016 г., в 0:51, Andres Freund > > написал(а): >> >> Hi Vladimir, >> >> Thanks for these reports. >> >> On 2016-06-13 00:42:19 +0300, Vladimir Borodin wrote: >>> perf report -g -i pg9?_all.dat

Re: [HACKERS] Statistics Injection

2016-07-04 Thread Victor Giannakouris - Salalidis
Hello, pg_dbms_stats worked well for my case, thank you all for your quick responses and for the support! Victor On Sat, Jul 2, 2016 at 8:28 PM, Vladimir Sitnikov < sitnikov.vladi...@gmail.com> wrote: > > > > The problem is that, even if I set the reltuples and relpages of my > choice, when I r

Re: [HACKERS] Reviewing freeze map code

2016-07-04 Thread Amit Kapila
On Mon, Jul 4, 2016 at 2:31 PM, Masahiko Sawada wrote: > On Sat, Jul 2, 2016 at 12:17 PM, Amit Kapila wrote: >> On Sat, Jul 2, 2016 at 12:53 AM, Andres Freund wrote: >>> On 2016-07-01 15:18:39 -0400, Robert Haas wrote: >>> Should we just clear all-visible and call it good enough? >>> >>> Gi

Re: [HACKERS] Declarative partitioning

2016-07-04 Thread Ashutosh Bapat
Hi Amit, I observed that the ChangeVarNodes call at line 1229 in get_relation_constraints() (code below) changes the varno in the cached copy of partition key expression, which is undesirable. The reason for this seems to be that the RelationGetPartitionCheckQual() returns the copy of partition key

[HACKERS] Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]

2016-07-04 Thread Andrew Borodin
Here is a patch with corrections from Alexander Korotkov. My tests, check and check-world show no problems against Ubuntu LTS 14 x64 VM. Best regards, Andrey Borodin, Octonica & Ural Federal University. 2016-07-04 10:41 GMT+05:00 Andrew Borodin : > Hi! >>I think you should implement PageReplaceI

[HACKERS] oddity in initdb probing of max_connections/shared_buffers

2016-07-04 Thread Greg Stark
I happened to notice a bit of an inconsistency in the way initdb probes max_connections and shared_buffers. This line in the shared_buffers test: /* Use same amount of memory, independent of BLCKSZ */ test_buffs = (trial_bufs[i] * 8192) / BLCKSZ; has no equivalent in the max_connections test. As

Re: [HACKERS] Cluster on NAS and data center.

2016-07-04 Thread Krzysztof Kaczkowski
Hello, About Your question, please do not ask. This infrastructure is an outcome of a very long talk with supervisors. Back to the topic. I like the tricky part. Do You think there is some way to achieve this on compilation level or shall we search somewhere else? For example UNIX libraries or ev

Re: [HACKERS] Cluster on NAS and data center.

2016-07-04 Thread Craig Ringer
On 4 July 2016 at 17:33, Krzysztof Kaczkowski wrote: > Hello everyone, > > Right now we have PostgreSQL on Windows Server (main data center) and > cluster is placed on NAS. We have emergency data center on UNIX > architecture. We want that emergency data center could continue work on > PostgreSQL

[HACKERS] Cluster on NAS and data center.

2016-07-04 Thread Krzysztof Kaczkowski
Hello everyone, Right now we have PostgreSQL on Windows Server (main data center) and cluster is placed on NAS. We have emergency data center on UNIX architecture. We want that emergency data center could continue work on PostgreSQL cluster that has been used by Windows PostgreSQL. We know that s

Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.

2016-07-04 Thread Heikki Linnakangas
On 18/03/16 19:19, Anastasia Lubennikova wrote: Please, find the new version of the patch attached. Now it has WAL functionality. Detailed description of the feature you can find in README draft https://goo.gl/50O8Q0 This patch is pretty complicated, so I ask everyone, who interested in this fe

Re: [HACKERS] Reviewing freeze map code

2016-07-04 Thread Masahiko Sawada
On Sat, Jul 2, 2016 at 12:17 PM, Amit Kapila wrote: > On Sat, Jul 2, 2016 at 12:53 AM, Andres Freund wrote: >> On 2016-07-01 15:18:39 -0400, Robert Haas wrote: >>> On Fri, Jul 1, 2016 at 10:22 AM, Masahiko Sawada >>> wrote: >>> > Ah, you're right, I misunderstood. >>> > >>> > Attached updated p

Re: [HACKERS] Reviewing freeze map code

2016-07-04 Thread Masahiko Sawada
On Sat, Jul 2, 2016 at 12:34 PM, Amit Kapila wrote: > On Fri, Jul 1, 2016 at 7:52 PM, Masahiko Sawada wrote: >> On Fri, Jul 1, 2016 at 11:12 AM, Amit Kapila wrote: >>> >>> Why do you think IndexOnlyScan will return wrong result? If the >>> server crash in the way as you described, the transacti

Re: [HACKERS] [CF2016-9] Allow spaces in working path on tap-tests

2016-07-04 Thread Michael Paquier
On Mon, Jul 4, 2016 at 4:29 PM, Michael Paquier wrote: > On Mon, Jul 4, 2016 at 4:02 PM, Kyotaro HORIGUCHI > wrote: >> Hello, this is just an entry mail for the next CF. >> >> The tap-test fails when the soruce directoy containing spaces. I >> accidentially hit this by a Jenkins project with the

Re: [HACKERS] [CF2016-9] Allow spaces in working path on tap-tests

2016-07-04 Thread Michael Paquier
On Mon, Jul 4, 2016 at 4:02 PM, Kyotaro HORIGUCHI wrote: > Hello, this is just an entry mail for the next CF. > > The tap-test fails when the soruce directoy containing spaces. I > accidentially hit this by a Jenkins project with the name "test > project". > > The function system_log() is safe for

[HACKERS] Renaming more clearly SHA functions in pgcrypto/

2016-07-04 Thread Michael Paquier
Hi all, (folks interested in that in CC) While looking at some facility in pgcrypto, I have noticed the stanza created by 56f4478 to prevent conflicts with OpenSSL, like that: +#define SHA256_Init pg_SHA256_Init +#define SHA256_Update pg_SHA256_Update Wouldn't it be better to avoid that, and just

[HACKERS] [CF2016-9] Allow spaces in working path on tap-tests

2016-07-04 Thread Kyotaro HORIGUCHI
Hello, this is just an entry mail for the next CF. The tap-test fails when the soruce directoy containing spaces. I accidentially hit this by a Jenkins project with the name "test project". The function system_log() is safe for such parameters but backup() uses it in wrong way. On the other hand,