Re: Thinko/typo in ExecSimpleRelationInsert

2018-06-27 Thread Amit Kapila
On Wed, Jun 27, 2018 at 11:30 AM, Ashutosh Bapat wrote: > On Wed, Jun 27, 2018 at 11:24 AM, Amit Kapila wrote: >>> >>> I don't understand what do you mean by consistent. Do you mean to say >>> that current usage " Store the slot into tuple ... " is correct? >>> >> >> Oh no, I was talking about

Re: Few cosmetic suggestions for commit 16828d5c (Fast Alter Table Add Column...)

2018-06-27 Thread Amit Kapila
On Tue, Jun 26, 2018 at 7:11 PM, Alvaro Herrera wrote: > On 2018-Jun-26, Amit Kapila wrote: > >> Andrew, Alvaro, do you think we can go ahead with above naming >> suggestions or do we want to brainstorm more on it? > > Looks good to me in a quick skim. > Thanks, pushed! -- With Regards, Amit

RE: "wal receiver" process hang in syslog() while exiting after receiving SIGTERM while the postgres has been promoted.

2018-06-27 Thread Chen, Yan-Jack (NSB - CN/Hangzhou)
Hi, It is mentioned by CWE-479(https://cwe.mitre.org/data/definitions/479.html). Quote: "Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption... Many functions are not

Re: Does logical replication supports cross platform servers?

2018-06-27 Thread Haribabu Kommi
On Sun, Jun 24, 2018 at 6:36 AM Bruce Momjian wrote: > On Wed, Jun 13, 2018 at 11:42:14AM +1000, Haribabu Kommi wrote: > > > > Thanks for the confirmation. > > This is a good use case that must be explicitly mentioned in the docs. > > How about the attached patch? > > OK, doc patch added to git

Re: effect of JIT tuple deform?

2018-06-27 Thread Tomas Vondra
On 06/26/2018 09:25 PM, Pavel Stehule wrote: Hi ... So I am able to see effect of jit_tuple_deforming, and very well, but only if optimization is active. When optimization is not active then jit_tuple_deforming does slowdown. So maybe a usage of jit_tuple_deforming can be conditioned by

Re: partitioning - changing a slot's descriptor is expensive

2018-06-27 Thread Ashutosh Bapat
On Wed, Jun 27, 2018 at 10:39 AM, Andres Freund wrote: > Hi, > > (sorry if I CCed the wrong folks, the code has changed a fair bit) > > I noticed that several places in the partitioning code look like: > > /* > * If the tuple has been routed, it's been converted to the > *

Forbid referencing columns by names in ALTER INDEX ... SET STATISTICS

2018-06-27 Thread Yugo Nagata
Hi, According to the syntax in ALTER INDEX doc, a column should be specified by column number as discussed in [1]. However, the current code still allows to use an internal column name like "expr". Is this intentional? Although it is harmless, how about forbiding this undocumented and unuseful

CREATE TABLE .. LIKE .. EXCLUDING documentation

2018-06-27 Thread Yugo Nagata
Hi, I found that there isn't explanation about EXCLUDING in CREATE TABLE doc. Attached is a patch to add this. I would appreciate it if a native English speaker comments on this. Regards, -- Yugo Nagata diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index

Re: [HACKERS] proposal: schema variables

2018-06-27 Thread Pavel Stehule
2018-06-27 19:15 GMT+02:00 Gilles Darold : > Le 27/06/2018 à 13:22, Pavel Stehule a écrit : > > Hi > > 2018-06-27 12:21 GMT+02:00 Gilles Darold : > >> Hi, >> >> I'm reviewing the patch as it was flagged in the current commit fest. >> Here are my feedback: >> >> - The patch need to be rebased due

Re: assert in nested SQL procedure call in current HEAD

2018-06-27 Thread Andres Freund
Hi Peter, On 2018-06-10 21:06:59 +0200, Dmitry Dolgov wrote: > > On 8 June 2018 at 06:20, Andrew Gierth wrote: > > > Joe> My colleague Yogesh Sharma discovered an assert in nested SQL > > Joe> procedure calls after ROLLBACK is used. Minimal test case and > > Joe> backtrace below. I have not

Re: assert in nested SQL procedure call in current HEAD

2018-06-27 Thread Peter Eisentraut
On 6/27/18 17:44, Andres Freund wrote: > This hasn't progressed in a while. Peter, since you committed the > relevant change, could you update us please? I've been on vacation for a bit. I will work on this next. I hope to have a solution in a few days. -- Peter Eisentraut

Re: SCRAM with channel binding downgrade attack

2018-06-27 Thread Peter Eisentraut
On 6/14/18 13:43, Magnus Hagander wrote: > I still think that the fact that we are still discussing what is > basically the *basic concepts* of how this would be set up after we have > released beta1 is a clear sign that this should not go into 11. Other than some naming and handling of some

Re: effect of JIT tuple deform?

2018-06-27 Thread Pavel Stehule
2018-06-27 17:19 GMT+02:00 Tomas Vondra : > On 06/26/2018 09:25 PM, Pavel Stehule wrote: > >> Hi >> >> ... >> >> So I am able to see effect of jit_tuple_deforming, and very well, but >> only if optimization is active. When optimization is not active then >> jit_tuple_deforming does slowdown. >>

Re: Small fixes about backup history file in doc and pg_standby

2018-06-27 Thread Yugo Nagata
On Wed, 27 Jun 2018 18:36:46 +0900 Michael Paquier wrote: > On Wed, Jun 27, 2018 at 05:42:07PM +0900, Yugo Nagata wrote: > > On Wed, 27 Jun 2018 00:58:18 +0900 > > Fujii Masao wrote: > >>> In addition, the current pg_standby still can handle a backup history > >>> file that are > >>> never

Re: wrong query result with jit_above_cost= 0

2018-06-27 Thread Dmitry Dolgov
> On 26 June 2018 at 22:56, Andres Freund wrote: > On 2018-06-26 21:55:07 +0100, Andrew Gierth wrote: >> > "Dmitry" == Dmitry Dolgov <9erthali...@gmail.com> writes: >> >> Dmitry> Yep, my bad, forgot to turn it on. Now I see what's the >> Dmitry> problem, one of the null fields is screwed

Re: WAL prefetch

2018-06-27 Thread Tomas Vondra
On 06/27/2018 11:44 AM, Konstantin Knizhnik wrote: ... I have improved my WAL prefetch patch. The main reason of slowdown recovery speed with enabled prefetch was that it doesn't take in account initialized pages  (XLOG_HEAP_INIT_PAGE) and doesn't remember (cache) full page writes. The main

Re: "wal receiver" process hang in syslog() while exiting after receiving SIGTERM while the postgres has been promoted.

2018-06-27 Thread Fujii Masao
>> We encounter one problem happened while we try to promote standby >> postgres(version 9.6.9) server to active. From the trace(we triggered the >> process abort). We can see the process was hang in syslog() while handling >> SIGTERM. According to below article. Looks it is risky to write

Re: Supporting tls-server-end-point as SCRAM channel binding for OpenSSL 1.0.0 and 1.0.1

2018-06-27 Thread Peter Eisentraut
On 6/23/18 17:09, Bruce Momjian wrote: > On Wed, Jun 6, 2018 at 01:16:11PM -0700, Steven Fackler wrote: >> TLS 1.3, (which is currently in a draft state, but is theoretically being >> finalized soon) does not support the TLS channel binding algorithms [1]. From > > Uh, according to this article,

Re: Jsonb transform for pl/python

2018-06-27 Thread Peter Eisentraut
On 6/23/18 01:44, Nikita Glukhov wrote: > We are simply trying first to convert numeric to int64 if is does not have > digits after the decimal point, and then construct Python Int instead of > Decimal. Standard Python json.loads() does the same for exact integers. We just had a very similar but

Re: [HACKERS] proposal: schema variables

2018-06-27 Thread Gilles Darold
Le 27/06/2018 à 13:22, Pavel Stehule a écrit : Hi 2018-06-27 12:21 GMT+02:00 Gilles Darold >: Hi, I'm reviewing the patch as it was flagged in the current commit fest. Here are my feedback:  - The patch need to be rebased due to changes in

Re: SCRAM with channel binding downgrade attack

2018-06-27 Thread Alvaro Herrera
Going over this thread a little bit I'm confused about what is being proposed. I think I understand that we no longer think we have have SCRAM channel binding. I hope that doesn't mean we don't have SCRAM itself. However, in terms of the Postgres release proper, what do we need to do? There is

Re: Speedup of relation deletes during recovery

2018-06-27 Thread Andres Freund
On 2018-06-28 03:21:51 +0900, Fujii Masao wrote: > On Wed, Jun 27, 2018 at 10:44 AM, Thomas Munro > wrote: > > On Wed, Jun 27, 2018 at 1:13 PM, Thomas Munro > > wrote: > >> On Wed, Jun 27, 2018 at 12:16 PM, Thomas Munro > >> wrote: > >>> I think we should take the hint in the comments and make

Re: Speedup of relation deletes during recovery

2018-06-27 Thread Fujii Masao
On Wed, Jun 27, 2018 at 10:44 AM, Thomas Munro wrote: > On Wed, Jun 27, 2018 at 1:13 PM, Thomas Munro > wrote: >> On Wed, Jun 27, 2018 at 12:16 PM, Thomas Munro >> wrote: >>> I think we should take the hint in the comments and make it O(1) >>> anyway. See attached draft patch. >> >>

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Peter Geoghegan
On Wed, Jun 27, 2018 at 12:52 PM, Andres Freund wrote: > A related question is if it matters - without complicating the code I > don't see how we could release all the locks in that loop. Therefore no > interrupts can be accepted. I hope I'm missing something? I agree. In general, page

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Andres Freund
Hi, On 2018-06-27 12:16:29 -0700, Andres Freund wrote: > I couldn't see how to fix the _bt_unlink_halfdead_page() right-sib loop, > because we always hold a lock. But given that that loop appears to > mostly be dead code, that doesn't seem too bad? It's possibly wrong that it's unreachable -

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Peter Geoghegan
On Wed, Jun 27, 2018 at 12:18 PM, Andres Freund wrote: > It's possibly wrong that it's unreachable - I've just not managed to get > there. If somebody has an idea how to build a reproducible case to reach > it... Set a breakpoint in _bt_unlink_halfdead_page() after the initial

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Andres Freund
Hi, On 2018-06-27 12:49:56 -0700, Peter Geoghegan wrote: > On Wed, Jun 27, 2018 at 12:18 PM, Andres Freund wrote: > > It's possibly wrong that it's unreachable - I've just not managed to get > > there. If somebody has an idea how to build a reproducible case to reach > > it... > > Set a

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-06-27 Thread Alvaro Herrera
On 2018-Jun-19, Amit Langote wrote: > In CreateTrigger(), 86f575948c7 did this. > > -values[Anum_pg_trigger_tgisinternal - 1] = BoolGetDatum(isInternal); > +values[Anum_pg_trigger_tgisinternal - 1] = BoolGetDatum(isInternal || > in_partition); > > I'm not sure why it had to be done, but

Re: Performance regression with PostgreSQL 11 and partitioning

2018-06-27 Thread Alvaro Herrera
On 2018-Jun-27, Amit Langote wrote: > I noticed that there is a typo in a comment, fixed as follows in the > attached patch. > > /* > - * append_rel_list is the same length as the above arrays, and holds > + * append_rel_array is the same length as the above arrays, and holds >

Re: adding tab completions

2018-06-27 Thread Justin Pryzby
On Mon, Jun 11, 2018 at 11:35:51PM +0300, Arthur Zakirov wrote: > IMHO, I'd leave the code as simple as possible. It is up to you of > course. But it is easy to add completion for a first attribute, by > adding the condition (and leave other attributes without completion): > > else if

ALTER TABLE on system catalogs

2018-06-27 Thread Peter Eisentraut
ALTER TABLE on system catalogs is occasionally useful, for example ALTER TABLE pg_attribute SET (autovacuum_vacuum_scale_factor=0); However, this doesn't actually work. The above command produces ERROR: AccessExclusiveLock required to add toast table. If it's a shared catalog, it

Re: ALTER TABLE on system catalogs

2018-06-27 Thread Andres Freund
Hi, On 2018-06-27 22:31:30 +0200, Peter Eisentraut wrote: > ALTER TABLE on system catalogs is occasionally useful, for example > > ALTER TABLE pg_attribute SET (autovacuum_vacuum_scale_factor=0); > However, this doesn't actually work. The above command produces > > ERROR:

Re: New GUC to sample log queries

2018-06-27 Thread Adrien Nayrat
On 06/24/2018 08:41 PM, Vik Fearing wrote: > On 24/06/18 13:22, Adrien Nayrat wrote: >> Attached third version of the patch with documentation. > > Hi. I'm reviewing this. Hi, thanks for your review. > >> exceeded = (log_min_duration_statement == 0 || >>

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Andres Freund
On 2018-06-27 13:02:25 -0700, Peter Geoghegan wrote: > On Wed, Jun 27, 2018 at 12:52 PM, Andres Freund wrote: > > A related question is if it matters - without complicating the code I > > don't see how we could release all the locks in that loop. Therefore no > > interrupts can be accepted. I

Listing triggers in partitions (was Re: Remove mention in docs that foreign keys on partitioned tables)

2018-06-27 Thread Alvaro Herrera
Gmail users: this comes from https://postgr.es/m/20180627191819.6g73wu7ck23fdhv6@alvherre.pgsql On 2018-Jun-27, Alvaro Herrera wrote: > On 2018-Jun-19, Amit Langote wrote: > > > In CreateTrigger(), 86f575948c7 did this. > > > > -values[Anum_pg_trigger_tgisinternal - 1] =

Re: Monitoring time of fsyncing WALs

2018-06-27 Thread David Steele
On 6/27/18 12:32 PM, Konstantin Knizhnik wrote: I wonder why we are monitoring time of writing to WAL, but not time of fsyncing WAL segments? Is there are principle reason for it or just because nobody added it yet? If so, please find very small patch which adding WAIT_EVENT_WAL_FSYNC event

Re: Allow cancelling VACUUM of nbtrees with corrupted right links

2018-06-27 Thread Peter Geoghegan
On Wed, Jun 27, 2018 at 1:11 PM, Andres Freund wrote: > Well, I don't really want to generally do better. Just be able to check > for interrupts ;) That's what I meant. :-) -- Peter Geoghegan

Re: Global shared meta cache

2018-06-27 Thread AJG
Ideriha, Takeshi wrote > 2) benchmarked 3 times for each conditions and got the average result of > TPS. > |master branch | prototype | > proto/master (%) > > >

Re: PANIC during crash recovery of a recently promoted standby

2018-06-27 Thread Michael Paquier
Adding Heikki and Andres in CC here for awareness.. On Wed, Jun 27, 2018 at 05:29:38PM +0900, Michael Paquier wrote: > I have spent a bit of time testing this on HEAD, 10 and 9.6. For 9.5, > 9.4 and 9.3 I have reproduced the failure and tested the patch, but I > lacked time to perform more

Re: ENOSPC FailedAssertion("!(RefCountErrors == 0)"

2018-06-27 Thread Michael Paquier
On Wed, Jun 27, 2018 at 06:39:39PM -0500, Justin Pryzby wrote: > < 2018-06-17 11:38:45.465 CDT pryzbyj >FATAL: the database system is in > recovery mode > < 2018-06-17 11:38:45.466 CDT pryzbyj >FATAL: the database system is in > recovery mode > < 2018-06-17 11:38:45.468 CDT >FATAL: could not

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2018-06-27 Thread Ashutosh Bapat
On Wed, Jun 27, 2018 at 12:28 PM, Amit Langote wrote: > On 2018/06/26 18:02, Ashutosh Bapat wrote: >> On Tue, Jun 26, 2018 at 2:27 PM, Amit Langote >> wrote: >>> Hi Ashutosh, >>> >>> On 2018/05/14 20:14, Ashutosh Bapat wrote: 0001-Hash-partition-bound-equality-refactoring.patch

Re: Name of main process differs between servers (postmaster vs postgres)

2018-06-27 Thread Jonathan Lemig
> > ​Best guess, one of the servers has upgrades from previous versions > applied to it while the other started with a newer release. The upgraded > server didn't mess with a pre-existing launch script that was using > postmaster while the new one made use of the likely newer script that calls >

Re: [WIP] [B-Tree] Retail IndexTuple deletion

2018-06-27 Thread Peter Geoghegan
On Tue, Jun 26, 2018 at 3:31 AM, Masahiko Sawada wrote: > bttargetdelete doesn't delete btree pages even if pages become empty. > I think we should do that. Otherwise empty page never be recycled. But > please note that if we delete btree pages during bttargetdelete, > recyclable pages might not

ENOSPC FailedAssertion("!(RefCountErrors == 0)"

2018-06-27 Thread Justin Pryzby
While grepping logs, I came across this crash, which I caused while adding many indices in a test environment. I don't know that there's any reason to believe one way or the other if this is specific to running on pg11b1. < 2018-06-17 11:38:45.465 CDT pryzbyj >FATAL: the database system is in

Re: jsonpath

2018-06-27 Thread Nikita Glukhov
Attached 15th version of the patches. There are changes only in jsonpath lexer: * added single-quoted strings * added escape sequences \v, \', \xXX, \u{...} It's all required by ECMAScript standard (ECMA-262), from which SQL/JSON standard adopts lexical rules. Also, the documentation has

Re: [WIP] [B-Tree] Retail IndexTuple deletion

2018-06-27 Thread Peter Geoghegan
On Tue, Jun 26, 2018 at 11:40 PM, Andrey V. Lepikhov wrote: > I still believe that the patch for physical TID ordering in btree: > 1) has its own value, not only for target deletion, > 2) will require only a few local changes in my code, > and this patches can be developed independently. I want

Capitalization of the name OpenSSL

2018-06-27 Thread Daniel Gustafsson
Skimming over SSL code and docs I noticed that we almost always properly capitalize “OpenSSL" when referring to the name of the library, using "openssl” for when referring to the cli application. The attached patch fixes the few occurrences where the name is referred to, but which aren’t spelled

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-06-27 Thread Alvaro Herrera
On 2018-Jun-18, Robert Treat wrote: > One of the things I was thinking about while reading this thread is > that the scenario of creating "duplicate" triggers on a table meaning > two triggers doing the same thing is entirely possible now but we > don't really do anything to prevent it, which is

Re: ALTER TABLE on system catalogs

2018-06-27 Thread Michael Paquier
On Wed, Jun 27, 2018 at 01:37:33PM -0700, Andres Freund wrote: > On 2018-06-27 22:31:30 +0200, Peter Eisentraut wrote: >> I propose that we instead silently ignore attempts to add TOAST tables >> to shared and system catalogs after bootstrapping. > > That seems like an extremely bad idea to me.

Re: Listing triggers in partitions (was Re: Remove mention in docs that foreign keys on partitioned tables)

2018-06-27 Thread David Rowley
On 28 June 2018 at 09:01, Alvaro Herrera wrote: > Another angle is that we're already in beta3 and there may be concerns > about altering catalog definition this late in the cycle. Anybody? > Maybe psql can just match tgisinternal triggers by name, and if one > match occurs then we assume it's a

Re: Listing triggers in partitions (was Re: Remove mention in docs that foreign keys on partitioned tables)

2018-06-27 Thread Alvaro Herrera
On 2018-Jun-28, David Rowley wrote: > On 28 June 2018 at 09:01, Alvaro Herrera wrote: > > Another angle is that we're already in beta3 and there may be concerns > > about altering catalog definition this late in the cycle. Anybody? > > Maybe psql can just match tgisinternal triggers by name,

Re: Concurrency bug in UPDATE of partition-key

2018-06-27 Thread Amit Khandekar
On 26 June 2018 at 17:53, Amit Kapila wrote: > Yeah, so let's leave it as it is in the patch. Ok. > I think now we should wait and see what Alvaro has to say about the overall > patch. Yeah, that's very good that Alvaro is also having a look at this. -- Thanks, -Amit Khandekar EnterpriseDB

Re: Loaded footgun open_datasync on Windows

2018-06-27 Thread Laurenz Albe
Michael Paquier wrote: > > I have added it to the July commitfest. > > Have you looked at the possibility of removing the log file constraints > in pg_upgrade with the change you are doing here so as things would be > more consistent with non-Windows platforms, simplifying some code on the > way?

Re: [HACKERS] proposal: schema variables

2018-06-27 Thread Gilles Darold
Hi, I'm reviewing the patch as it was flagged in the current commit fest. Here are my feedback:  - The patch need to be rebased due to changes in file src/sgml/catalogs.sgml  - Some compilation warning must be fixed: analyze.c: In function ‘transformLetStmt’: analyze.c:1568:17:

Re: commitfest app moving patch error

2018-06-27 Thread Magnus Hagander
On Wed, Jun 27, 2018 at 8:20 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > I tried to move a patch from 2018-07 to 2018-09 and got this error: > > "Cannot move patch to the same commitfest, and multiple future > commitfests exist!" > Right. You are only supposed to "move to

Re: partitioning - changing a slot's descriptor is expensive

2018-06-27 Thread Amit Langote
On 2018/06/27 14:55, Andres Freund wrote: > On 2018-06-27 14:46:26 +0900, Amit Langote wrote: >> There is however similar code that runs in non-error paths, such as in >> ExecPrepareTupleRouting(), that is executed *if* the leaf partition and >> the root parent have differing attribute numbers.

Re: [HACKERS] GnuTLS support

2018-06-27 Thread Peter Eisentraut
On 3/8/18 20:13, Peter Eisentraut wrote: > In the thread about Secure Transport we agreed to move the consideration > of new SSL libraries to PG12. > > Here is my current patch, after all the refactorings. > > The status is that it works fine and could be used. > > There are two failures in the

Re: Typo in llvm_function_reference

2018-06-27 Thread Andres Freund
Hi, On 2018-06-27 10:46:35 +0530, Rushabh Lathia wrote: > There is multiple return statement in llvm_function_reference > and that's definitely looks typo. Here is the patch to fix the > same. > diff --git a/src/backend/jit/llvm/llvmjit.c b/src/backend/jit/llvm/llvmjit.c > index daae964..5d0cdab

Re: ssl_library parameter

2018-06-27 Thread Peter Eisentraut
On 6/26/18 17:48, Tom Lane wrote: > (1) I'm not really clear why we need this. GUC variables aren't free. > > (2) Are there security issues with exposing this info to everybody? This functionality was requested in the threads about GnuTLS and other SSL implementations so that users/admins can

commitfest app moving patch error

2018-06-27 Thread Peter Eisentraut
I tried to move a patch from 2018-07 to 2018-09 and got this error: "Cannot move patch to the same commitfest, and multiple future commitfests exist!" -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

libpq example doesn't work

2018-06-27 Thread Ideriha, Takeshi
Hi, When I tried to use libpq, I found that libpq example[1] does not work. That's because SELECT pg_catlog.set_config() never returns PGRES_COMMAND_OK which is expected, but actually returns PGRES_TUPLES_OK. Patch attached. I changed both src/test/example and document. [1]

Re: Constraint documentation

2018-06-27 Thread Peter Eisentraut
On 6/26/18 09:49, Lætitia Avrot wrote: > + > + > + Check constraints are not designed to enforce business rules across > tables. > + Avoid using check constraints with a function accessing other tables and > + use instead. Although PostgreSQL won't > prevent you > + from

Re: Server crashed with TRAP: FailedAssertion("!(parallel_workers > 0)" when partitionwise_aggregate true.

2018-06-27 Thread Jeevan Chalke
On Fri, Jun 22, 2018 at 6:58 PM, Robert Haas wrote: > On Fri, Jun 22, 2018 at 2:26 AM, Rajkumar Raghuwanshi > wrote: > > I have applied patch and checked reported issue. Patch applied cleanly > and > > issues not reproducible any more. > > Committed, with a few changes: > Thanks Robert. > >

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Pavel Stehule
2018-06-27 8:45 GMT+02:00 Amit Langote : > On 2018/06/27 15:33, Pavel Stehule wrote: > >>> Unfortunately, when I use identity column > >>> > >>> create table foo(a int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, b > >> date > >>> default current_date, c int); > >>> > >>> then import doesn't

Re: Thinko/typo in ExecSimpleRelationInsert

2018-06-27 Thread Ashutosh Bapat
On Wed, Jun 27, 2018 at 11:24 AM, Amit Kapila wrote: >> >> I don't understand what do you mean by consistent. Do you mean to say >> that current usage " Store the slot into tuple ... " is correct? >> > > Oh no, I was talking about replacing it with below comment which is > used at other places

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Amit Langote
On 2018/06/27 2:47, Pavel Stehule wrote: > 2018-06-25 4:30 GMT+02:00 Amit Langote : >> It seems you missed using OPTIONS (import_default 'true') here. >> >> create schema foo; >> create table foo.foo (a serial primary key, b date default current_date >> not null, c int); >> >> import foreign

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Amit Langote
On 2018/06/27 15:33, Pavel Stehule wrote: >>> Unfortunately, when I use identity column >>> >>> create table foo(a int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, b >> date >>> default current_date, c int); >>> >>> then import doesn't fail, but still it doesn't work >> >> It seems that, unlike

Re: Portability concerns over pq_sendbyte?

2018-06-27 Thread Andres Freund
Hi, On 2018-06-14 13:25:30 -0700, Andres Freund wrote: > On 2018-06-14 16:17:28 -0400, Tom Lane wrote: > > Alvaro Herrera writes: > > > How about not renaming the functions, but just change argument types? > > Yea, I'm in favor of this. I don't think the 'u' in there would benefit > us, and the

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2018-06-27 Thread Amit Langote
On 2018/06/26 18:02, Ashutosh Bapat wrote: > On Tue, Jun 26, 2018 at 2:27 PM, Amit Langote > wrote: >> Hi Ashutosh, >> >> On 2018/05/14 20:14, Ashutosh Bapat wrote: >>> 0001-Hash-partition-bound-equality-refactoring.patch >>> 0002-Targetlist-of-a-child-join-is-produced-by-translatin.patch >>>

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Pavel Stehule
2018-06-27 11:12 GMT+02:00 Pavel Stehule : > > > 2018-06-27 9:30 GMT+02:00 Amit Langote : > >> On 2018/06/27 15:59, Pavel Stehule wrote: >> > 2018-06-27 8:45 GMT+02:00 Amit Langote : >> >> On 2018/06/27 15:33, Pavel Stehule wrote: >> >>> I don't understand, why is necessary to replace missing

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Pavel Stehule
2018-06-27 11:19 GMT+02:00 Pavel Stehule : > > > 2018-06-27 11:12 GMT+02:00 Pavel Stehule : > >> >> >> 2018-06-27 9:30 GMT+02:00 Amit Langote : >> >>> On 2018/06/27 15:59, Pavel Stehule wrote: >>> > 2018-06-27 8:45 GMT+02:00 Amit Langote >> >: >>> >> On 2018/06/27 15:33, Pavel Stehule wrote: >>>

Re: Small fixes about backup history file in doc and pg_standby

2018-06-27 Thread Michael Paquier
On Wed, Jun 27, 2018 at 05:42:07PM +0900, Yugo Nagata wrote: > On Wed, 27 Jun 2018 00:58:18 +0900 > Fujii Masao wrote: >>> In addition, the current pg_standby still can handle a backup history file >>> that are >>> never requested. It is harmless but unnecessary code. Another attached patch >>>

Re: Portability concerns over pq_sendbyte?

2018-06-27 Thread Michael Paquier
On Tue, Jun 26, 2018 at 11:51:49PM -0700, Andres Freund wrote: > Looking at surrounding code I found a few more oddities, but of older > vintage: > - pq_sendfloat4 uses an uint32 in the union, but float8 uses a int64. > - same with pq_getmsgfloat[48] > - pq_getmsgint64 returns a int64, should

Re: Small fixes about backup history file in doc and pg_standby

2018-06-27 Thread Yugo Nagata
On Tue, 26 Jun 2018 20:19:42 +0900 (Tokyo Standard Time) Kyotaro HORIGUCHI wrote: > Hello. > > Good catch! > > At Tue, 26 Jun 2018 17:47:52 +0900, Yugo Nagata wrote > in <20180626174752.0ce505e3.nag...@sraoss.co.jp> > > Hi, > > > > While looking into the backup and recovery code, I found

Utilisation of get_page_from_raw() in pageinspect

2018-06-27 Thread Ashutosh Sharma
Hi All, Currently, get_page_from_raw() is not used in the pageinspect functions for btree and heap to fetch a page image from raw page. However, the pageinspect for gin and hash is using it to avoid server crash on alignment picky machines with MAXALIGN = 8. Shouldn't we start using it in the

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Amit Langote
On 2018/06/27 15:59, Pavel Stehule wrote: > 2018-06-27 8:45 GMT+02:00 Amit Langote : >> On 2018/06/27 15:33, Pavel Stehule wrote: >>> I don't understand, why is necessary to replace missing values by NULLs? >>> >>> I didn't expect so insert into foo(c) values(10) >>> >>> will be translated to >>>

Re: Performance regression with PostgreSQL 11 and partitioning

2018-06-27 Thread Amit Langote
On 2018/06/26 23:43, Alvaro Herrera wrote: > On 2018-Jun-25, Tom Lane wrote: > >> Alvaro Herrera writes: >>> On 2018-Jun-18, David Rowley wrote: I've attached a patch which cleans up my earlier version and moves the setup of the append_rel_array into its own function instead of

Re: PANIC during crash recovery of a recently promoted standby

2018-06-27 Thread Michael Paquier
On Fri, Jun 22, 2018 at 03:25:48PM +0900, Michael Paquier wrote: > On Fri, Jun 22, 2018 at 02:34:02PM +0900, Kyotaro HORIGUCHI wrote: >> Hello, sorry for the absense and I looked the second patch. > > Thanks for the review! I have been spending some time testing and torturing the patch for all

Re: Small fixes about backup history file in doc and pg_standby

2018-06-27 Thread Yugo Nagata
On Wed, 27 Jun 2018 00:58:18 +0900 Fujii Masao wrote: > On Tue, Jun 26, 2018 at 5:47 PM, Yugo Nagata wrote: > > Hi, > > > > While looking into the backup and recovery code, I found small > > documentation bugs. > > The documatation says that the backup history files can be requested for > >

Bulk Insert into PostgreSQL

2018-06-27 Thread Srinivas Karthik V
Hi, I am performing a bulk insert of 1TB TPC-DS benchmark data into PostgreSQL 9.4. It's taking around two days to insert 100 GB of data. Please let me know your suggestions to improve the performance. Below are the configuration parameters I am using: shared_buffers =12GB maintainence_work_mem =

Re: [HACKERS] proposal: schema variables

2018-06-27 Thread Pavel Stehule
Hi 2018-06-27 12:21 GMT+02:00 Gilles Darold : > Hi, > > I'm reviewing the patch as it was flagged in the current commit fest. Here > are my feedback: > > - The patch need to be rebased due to changes in file > src/sgml/catalogs.sgml > > - Some compilation warning must be fixed: > > analyze.c:

Re: Bulk Insert into PostgreSQL

2018-06-27 Thread Pavel Stehule
2018-06-27 13:18 GMT+02:00 Srinivas Karthik V : > Hi, > I am performing a bulk insert of 1TB TPC-DS benchmark data into PostgreSQL > 9.4. It's taking around two days to insert 100 GB of data. Please let me > know your suggestions to improve the performance. Below are the > configuration

RE: Bulk Insert into PostgreSQL

2018-06-27 Thread ROS Didier
Hi I suggest to split the data to insert into several text files ( the number of CPUs) , create extension pg_background, and create a main transaction which calls x (number of CPUs) autonomous transactions. Each one insert the data from a specific test file via the

Re: partition tree inspection functions

2018-06-27 Thread Michael Paquier
On Tue, Jun 26, 2018 at 04:57:53PM +0900, Amit Langote wrote: > Thanks Jeevan for reviewing. I would like to make things more user-friendly in this area, but could you add a couple of tests to show up how things work? I just had a very quick glance at what's proposed at the top of the thread. --

Re: SQL/JSON: functions

2018-06-27 Thread Pavel Stehule
2018-06-28 2:18 GMT+02:00 Nikita Glukhov : > On 15.03.2018 20:04, Nikita Glukhov wrote: > >> Attached 13th version of the patches: >> >> * Subtransactions in PG_TRY/CATCH in ExecEvalJsonExpr() were made >> unconditional, >> regardless of the volatility of expressions. >> >> * PG_TRY/CATCH in

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2018-06-27 Thread Amit Langote
On 2018/06/27 22:21, Ashutosh Bapat wrote: > On Wed, Jun 27, 2018 at 12:28 PM, Amit Langote >> Ah, okay. I thought of reporting this because I felt the errors may have >> to do with changes to the related code in HEAD between May 14 when you >> last posted the patches and today that you may need

Re: partition tree inspection functions

2018-06-27 Thread Amit Langote
Thanks again for quick review. On 2018/06/28 12:43, Michael Paquier wrote: > On Thu, Jun 28, 2018 at 11:50:13AM +0900, Amit Langote wrote: >> For now, I've added them to create_table.sql, but maybe that's not where >> they really belong. Attached updated patch with tests. > > It would have

Re: [HACKERS] Crash on promotion when recovery.conf is renamed

2018-06-27 Thread Michael Paquier
On Thu, Jan 11, 2018 at 10:35:22PM -0500, Stephen Frost wrote: > Magnus, this was your thread to begin with, though I know others have > been involved, any chance you'll be able to review this for commit > during this CF? I agree that this is certainly a good thing to have > too, though I've not

[GSoC] thrift compact protocol byte interface get implemented

2018-06-27 Thread Charles Cui
Hi mentors and hackers, The thrift compact protocol has been implemented. Right now there are two protocols supported in my plugin(binary and compact). I have added several tests and did some bug fixing. At the same time updated the documents in my repo (

Re: [WIP] [B-Tree] Retail IndexTuple deletion

2018-06-27 Thread Andrey V. Lepikhov
On 28.06.2018 05:00, Peter Geoghegan wrote: On Tue, Jun 26, 2018 at 11:40 PM, Andrey V. Lepikhov wrote: I still believe that the patch for physical TID ordering in btree: 1) has its own value, not only for target deletion, 2) will require only a few local changes in my code, and this

RE: Global shared meta cache

2018-06-27 Thread Tsunakawa, Takayuki
From: Ideriha, Takeshi [mailto:ideriha.take...@jp.fujitsu.com] > 1) Initialized with pgbench -i -s10 ... >pgbench -c48 -T60 -Msimple | 4956|4965 > |95% The scaling factor should be much greater than the number of clients. Otherwise, multiple clients would conflict on the same

Re: SQL/JSON: documentation

2018-06-27 Thread Chapman Flack
On 06/27/2018 07:36 PM, Nikita Glukhov wrote: > Also it can be found in our sqljson repository on sqljson_doc branch: > https://github.com/postgrespro/sqljson/tree/sqljson_doc Perhaps it is my unfamiliarity, but it seems that on lines 1067–1071, the output clause for JSON_VALUE is given support

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-06-27 Thread Amit Langote
On 2018/06/28 7:58, Alvaro Herrera wrote: > On 2018-Jun-18, Robert Treat wrote: >> So +1 for thinking we do need to worry about it. I'm not exactly sure >> how we want to expose that info; with \d+ we list various "Partition >> X:" sections, perhaps adding one for "Partition triggers:" would be >>

Re: jsonpath

2018-06-27 Thread Thomas Munro
On Thu, Jun 28, 2018 at 11:38 AM, Nikita Glukhov wrote: > Attached 15th version of the patches. Hi Nikita, I wonder why the Windows build scripts are not finding and processing your new .y and .l files: https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.3672 Perhaps

Re: partition tree inspection functions

2018-06-27 Thread Amit Langote
Thanks for taking a look. On 2018/06/27 21:16, Michael Paquier wrote: > I would like to make things more user-friendly in this area, but could > you add a couple of tests to show up how things work? I just had a very > quick glance at what's proposed at the top of the thread. I thought about

Copy function for logical replication slots

2018-06-27 Thread Masahiko Sawada
Hi, I'd like to propose a copy function for logical replication slots. Currently when we create a new logical replication slot it starts to read WAL from an LSN of the current insert. This function copies a existing logical replication slot while changing output plugin and persistence. That is,

Re: Capitalization of the name OpenSSL

2018-06-27 Thread Michael Paquier
On Thu, Jun 28, 2018 at 12:16:52AM +0200, Daniel Gustafsson wrote: > Skimming over SSL code and docs I noticed that we almost always properly > capitalize “OpenSSL" when referring to the name of the library, using > "openssl” > for when referring to the cli application. The attached patch fixes

Re: Copy function for logical replication slots

2018-06-27 Thread Michael Paquier
On Thu, Jun 28, 2018 at 11:51:20AM +0900, Masahiko Sawada wrote: > A use case I imagined is for investigations for example. I mean that > when replication collision occurs on subscriber there is no way to see > what replicated data is conflicting (perhaps error log helps it but is > not detailed)

Re: partition tree inspection functions

2018-06-27 Thread Michael Paquier
On Thu, Jun 28, 2018 at 11:50:13AM +0900, Amit Langote wrote: > For now, I've added them to create_table.sql, but maybe that's not where > they really belong. Attached updated patch with tests. It would have imagined that just creating a new file, say partition_desc.sql or similar is nicer. +