Re: [HACKERS] Logical decoding on standby

2017-12-08 Thread Craig Ringer
On 27 June 2017 at 13:24, Craig Ringer wrote: > On 21 June 2017 at 17:30, sanyam jain wrote: > > Hi, > > After changing > > sendTimeLineIsHistoric = state->currTLI == ThisTimeLineID; > > to > > sendTimeLineIsHistoric = state->currTLI !=

Re: [HACKERS] Proposal for CSN based snapshots

2017-12-08 Thread Alexander Korotkov
On Mon, Dec 4, 2017 at 6:07 PM, Alexander Kuzmenkov < a.kuzmen...@postgrespro.ru> wrote: > Performance on pgbench tpcb with subtransactions is now slightly better > than master. See the picture 'savepoints2'. This was achieved by removing > unnecessary exclusive locking on CSNLogControlLock in

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Daniel Vérité
Everaldo Canuto wrote: > Oracle's sqlplus uses "quit" or "exit" and MySQL client can be exited using > "quit" and "exit" but for compatibility with psql, it also supports "\q" > and "\quit". When looking at the most popular postgres questions on stackoverflow:

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Everaldo Canuto
Hello, On Fri, Dec 8, 2017 at 11:57 AM, Daniel Vérité" wrote: > Implementing it is easy, but it might be a hard sell for the project > because it creates a precedent. > We already have "help" (without slash) so I don't think it is a precedent. > The next question in

Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug

2017-12-08 Thread Alexander Korotkov
On Thu, Dec 7, 2017 at 8:59 PM, Robert Haas wrote: > On Tue, Nov 7, 2017 at 7:51 AM, Jan Przemysław Wójcik > wrote: > > I'm afraid that creating a function that implements quite different > > algorithms depending on a global parameter

Re: [HACKERS] [PATCH] Incremental sort

2017-12-08 Thread Alexander Korotkov
On Wed, Nov 22, 2017 at 12:01 AM, Thomas Munro < thomas.mu...@enterprisedb.com> wrote: > >> I gather that you have > >> determined empirically that it's better to be able to sort groups of > >> at least MIN_GROUP_SIZE than to be able to skip the comparisons on the > >> leading attributes, but why

Re: [HACKERS] [PATCH] Incremental sort

2017-12-08 Thread Alexander Korotkov
Hi! On Fri, Dec 1, 2017 at 11:39 AM, Antonin Houska wrote: > I expected the number of groups actually that actually appear in the > output, > you consider it the number of groups started. I can't find similar case > elsewhere in the code (e.g. Agg node does not report this

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Nikolay Samokhvalov
On Fri, Dec 8, 2017 at 2:10 AM, Michael Paquier wrote: > > I think that you are going to need better reasons than just being more > friendly with other database clients ... > This is not about other database clients. This is about users considering migration to

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Ryan Murphy
I am +1 on doing this too, unless we can imagine it clashing with any SQL queries or breaking scripts (which I can't). Helping people migrate to postgres w minimal frustration is important enough imho to be worth breaking this \ rule unless we can forsee real actual compatibility problems. We

Re: explain analyze output with parallel workers - question about meaning of information for explain.depesz.com

2017-12-08 Thread Amit Kapila
On Fri, Dec 8, 2017 at 9:33 AM, Amit Kapila wrote: > On Fri, Dec 8, 2017 at 12:06 AM, Robert Haas wrote: >> On Wed, Dec 6, 2017 at 1:05 AM, Amit Kapila wrote: >>> Right and seeing that I have prepared the patch (posted

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Michael Paquier
On Fri, Dec 8, 2017 at 7:06 PM, Everaldo Canuto wrote: > For people already know psql nothing is changed, we will just have a hidden > way to exit. > > I just think that if it don't change or break anything for usual psql user > but also help some new comers, then is

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-08 Thread Masahiko Sawada
On Fri, Dec 1, 2017 at 11:51 AM, Michael Paquier wrote: > On Wed, Nov 29, 2017 at 7:36 AM, Michael Paquier > wrote: >> On Wed, Nov 29, 2017 at 6:44 AM, Robert Haas wrote: >>> On Tue, Nov 21, 2017 at 4:32 AM, Masahiko

Re: [HACKERS] postgres_fdw bug in 9.6

2017-12-08 Thread Etsuro Fujita
(2017/11/30 23:22), Tom Lane wrote: Etsuro Fujita writes: (2017/11/30 7:32), Tom Lane wrote: the output of the foreign join cannot change during EPQ, since the remote server already locked the rows before returning them. The only thing that can change is the

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Everaldo Canuto
On Fri, Dec 8, 2017 at 5:22 AM, Sergei Kornilov wrote: > Why not just use ctrl+D shortcut? This EOF signal works both in bash, > mysql, psql, any CLI tool which I remember > Because like I wrote, other sql clients also support "exit" and "quit".

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Everaldo Canuto
On Fri, Dec 8, 2017 at 4:00 AM, Laurenz Albe wrote: > I am -1 on that, because I think that it is not good to break the simple > rule > that everything that is a psql command starts with a backslash. > We already have "help" command without slash and that is why I

no partition pruning when partitioning using array type

2017-12-08 Thread Amit Langote
Hi. I noticed that if you partition using a array type column, partition pruning using constraint exclusion fails to work due to a minor problem. Example: create table p (a int[]) partition by list (a); create table p1 partition of p for values in ('{1}'); create table p1 partition of p for

ScalarArrayOpExpr and multi-dimensional arrays

2017-12-08 Thread Amit Langote
Hi. I wonder if ScalarArrayOpExpr is not really meant for multi-dimensional arrays appearing on the right hand side? Because: # select array[1] = any (array[array[1], array[2]]); ERROR: operator does not exist: integer[] = integer LINE 1: select array[1] = any (array[array[1], array[2]]);

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-08 Thread Michael Paquier
On Fri, Dec 8, 2017 at 5:38 PM, Masahiko Sawada wrote: > After off-discussion with Fujii-san, I've updated the comment of why > we should disallow interrupts before setting/cleanup the session-level > lock. Please review it. + /* +* Set session-level lock. If

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Everaldo Canuto
On Fri, Dec 8, 2017 at 8:10 AM, Michael Paquier wrote: > > I think that you are going to need better reasons than just being more > friendly with other database clients by breaking a rule which is > around for 20 years. Well, that reason was enough for other sql

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2017-12-08 Thread Tels
Hello Rushabh, On Fri, December 8, 2017 2:28 am, Rushabh Lathia wrote: > Thanks for review. > > On Fri, Dec 8, 2017 at 6:27 AM, Peter Geoghegan wrote: > >> On Thu, Dec 7, 2017 at 12:25 AM, Rushabh Lathia >> wrote: >> >

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Everaldo Canuto
On Fri, Dec 8, 2017 at 2:26 PM, Vladimir Svedov wrote: > I wonder if *exit;* to terminate loop be confused with exit psql in case > of bad syntax. then instead of reporting error in plpgsql it would just > silently exit?.. > I just tested it and works as expected. Second line

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Oliver Ford
On Thu, Dec 7, 2017 at 11:47 PM, Everaldo Canuto wrote: > Some of us unfortunately have to work with multiple databases like Oracle or > MySQL. Their respective clients mysql and sqlplus uses "quit" or "exit" to > exit sql client. > > Oracle's sqlplus uses "quit" or

Re: ScalarArrayOpExpr and multi-dimensional arrays

2017-12-08 Thread Tom Lane
Amit Langote writes: > I wonder if ScalarArrayOpExpr is not really meant for multi-dimensional > arrays appearing on the right hand side? Because: > # select array[1] = any (array[array[1], array[2]]); > ERROR: operator does not exist: integer[] = integer You

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Ryan Murphy
> > ​There isn't going to be that much appetite for this just so that people > can use PostgreSQL without reading our documentation: or the output of > typing "help" at the psql prompt that says "type \q to quit".​ > > Agree with this. The whole reason people here are reluctant to add "quit" in

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread David G. Johnston
On Fri, Dec 8, 2017 at 8:09 AM, Ryan Murphy wrote: > ​There isn't going to be that much appetite for this just so that people >> can use PostgreSQL without reading our documentation: or the output of >> typing "help" at the psql prompt that says "type \q to quit".​ >> >>

Re: Allowing SSL connection of v11 client to v10 server with SCRAM channel binding

2017-12-08 Thread Peter Eisentraut
On 12/1/17 18:11, Michael Paquier wrote: > Cool. Thanks. For REL_10_STABLE, I would suggest the attached patch > then. This ensures that eSws is checked in the final message and that > the cbind-flag sent in the first message maps with the data of the > final message in the backend. I have checked

Re: [HACKERS] parallel.c oblivion of worker-startup failures

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 4:56 AM, Amit Kapila wrote: > I think the optimization you are suggesting has a merit over what I > have done in the patch. However, one point to note is that we are > anyway going to call that function down in the path( >

Re: [HACKERS] What does it mean by XLOG_BACKUP_RECORD?

2017-12-08 Thread Peter Eisentraut
On 6/29/17 06:09, Masahiko Sawada wrote: > Thanks, I agree to use XLOG_BACKUP_END instead. > >> Worse, the current comment implies that >> minRecoveryPoint is incorrectly set if it is true. Bleh. > > Looking at the condition, we use minRecoveryPoint only when > ControlFile->backupEndRequired is

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Vladimir Svedov
I wonder if *exit;* to terminate loop be confused with exit psql in case of bad syntax. then instead of reporting error in plpgsql it would just silently exit?.. 2017-12-08 15:19 GMT+00:00 Tom Lane : > "David G. Johnston" writes: > > I'll agree

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Oliver Ford
On Fri, Dec 8, 2017 at 3:10 PM, David G. Johnston wrote: > On Fri, Dec 8, 2017 at 7:34 AM, Oliver Ford wrote: >> >> On Thu, Dec 7, 2017 at 11:47 PM, Everaldo Canuto >> wrote: >> >> +1 from me. When I first used Postgres I

Re: Speeding up pg_upgrade

2017-12-08 Thread Mark Dilger
> On Dec 8, 2017, at 9:21 AM, Stephen Frost wrote: > > Mark, > > * Mark Dilger (hornschnor...@gmail.com) wrote: >>> On Dec 7, 2017, at 10:24 PM, Bruce Momjian wrote: >>> I think the big problem with two-stage pg_upgrade is that the user steps >>> are more

Re: Speeding up pg_upgrade

2017-12-08 Thread Stephen Frost
Bruce, * Bruce Momjian (br...@momjian.us) wrote: > I think the big problem with two-stage pg_upgrade is that the user steps > are more complex, so what percentage of users are going use the > two-stage method. The bad news is that only a small percentage of users > who will benefit from it will

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 3:20 AM, Masahiko Sawada wrote: >> The first hunk in monitoring.sgml looks unnecessary. > > You meant the following hunk? > > diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml > index 8d461c8..7aa7981 100644 > ---

Re: Speeding up pg_upgrade

2017-12-08 Thread Stephen Frost
Mark, * Mark Dilger (hornschnor...@gmail.com) wrote: > > On Dec 7, 2017, at 10:24 PM, Bruce Momjian wrote: > > I think the big problem with two-stage pg_upgrade is that the user steps > > are more complex, so what percentage of users are going use the > > two-stage method. The

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier wrote: > On Fri, Dec 8, 2017 at 5:38 PM, Masahiko Sawada wrote: >> After off-discussion with Fujii-san, I've updated the comment of why >> we should disallow interrupts before setting/cleanup the

Re: explain analyze output with parallel workers - question about meaning of information for explain.depesz.com

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 5:11 AM, Amit Kapila wrote: > The regression test added by patch needs cleanup at the end which I > have added in the attached patch. OK, so you've got a test case now, but Thomas independently submitted a test case patch. Which one is more

Re: no partition pruning when partitioning using array type

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 5:40 AM, Amit Langote wrote: > I noticed that if you partition using a array type column, partition > pruning using constraint exclusion fails to work due to a minor problem. > > Example: > > create table p (a int[]) partition by list (a); >

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 8:57 AM, Daniel Vérité" wrote: > When looking at the most popular postgres questions on stackoverflow: > > https://stackoverflow.com/questions/tagged/postgresql?sort=votes > > the first one (most up-voted) happens to be: > > "How to exit from

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 2:07 PM, Tom Lane wrote: >> Wow, that's pretty crazy. I was going to vote against this proposal, >> but I think I might change my mind. How can we say that this isn't a >> problem for users given that data? It's evidently not only *a* >> problem, but

Typo in recent commit

2017-12-08 Thread Robins Tharakan
Hi, Looks like a minor typo in the recent commit. s/identify/identity/ https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a2c6cf36608e10aa223fef49323b5feba344bfcf - robins | mobile

Re: Is it possible and worthy to optimize scanRTEForColumn()?

2017-12-08 Thread Andres Freund
On 2017-12-08 10:05:17 -0500, Tom Lane wrote: > I'm not particularly concerned about it --- I've not seen profiles > suggesting that that function is a big time sink. Tables with very > many columns tend to be inefficient for lots of reasons, and I rather > doubt that this particular place is the

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 10:28 AM, Szymon Lipiński wrote: > Well, if I have a new program I usually read some documentation. It really > helps people to exit vim as well :) Look, I love vim and use it constantly, but no reasonable person is going to hold it up as a good example

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Tom Lane
Robert Haas writes: > On Fri, Dec 8, 2017 at 2:07 PM, Tom Lane wrote: >> I'm not sure how we could get away with that. Would it pass muster to do >> that only when isatty(stdin)? Other ideas? > What if we made it so that "exit" or "quit" bails out

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread hvjunk
On 08 Des. 2017, at 20:56 , Robert Haas wrote: > > On Fri, Dec 8, 2017 at 8:57 AM, Daniel Vérité" > wrote: >> When looking at the most popular postgres questions on stackoverflow: >> >>

Re: Is it possible and worthy to optimize scanRTEForColumn()?

2017-12-08 Thread Andres Freund
Hi, On 2017-12-08 14:41:14 -0500, Tom Lane wrote: > Yeah, if someone were holding a gun on me and saying "make that particular > function faster", I'd think about a hash table rather than scanning a > list. Perhaps a hash table with all the column names exposed by FROM, > not one hash per RTE.

Re: Partition pruning for Star Schema

2017-12-08 Thread Mark Kirkwood
On 04/12/17 17:20, Mark Kirkwood wrote: On 04/12/17 16:08, Ashutosh Bapat wrote: On Sun, Dec 3, 2017 at 5:56 AM, legrand legrand wrote: Hello, I have a typical star schema, having dimension tables "product", "calendar" and "country" and a fact table "sales".

Re: [HACKERS] Re: Is anything preventing us from allowing write to foreign tables from standby?

2017-12-08 Thread Alexander Korotkov
On Wed, Nov 29, 2017 at 5:07 AM, Michael Paquier wrote: > On Fri, Oct 27, 2017 at 4:44 PM, Robert Haas > wrote: > > However, as Michael also points out, it's arguably wrong to allow a > > nominally read-only transaction to write data regardless

Faster str to int conversion (was Table with large number of int columns, very slow COPY FROM)

2017-12-08 Thread Andres Freund
Hi, On 2017-12-08 10:17:34 -0800, Andres Freund wrote: > the strtoll is libc functionality triggered by pg_atoi(), something I've > seen show up in numerous profiles. I think it's probably time to have > our own optimized version of it rather than relying on libcs. Attached is a hand-rolled

Re: Partition-wise aggregation/grouping

2017-12-08 Thread legrand legrand
Thank you for the answer This is a miss understanding of hash join behaviour on my side. That means that there is at less on line read in facts_p2 part even if the second table partition of the hash join operation is empty. I will remember it now ;o) Regards PAscal -- Sent from:

Re: pgsql: Prohibit identity columns on typed tables and partitions

2017-12-08 Thread Michael Paquier
On Sat, Dec 9, 2017 at 2:26 AM, Peter Eisentraut wrote: > Prohibit identity columns on typed tables and partitions > > Those cases currently crash and supporting them is more work then > originally thought, so we'll just prohibit these scenarios for now. +

Re: plpgsql fails to reinitialize record variables at block re-entry

2017-12-08 Thread Pavel Stehule
2017-12-09 7:24 GMT+01:00 Tom Lane : > Consider > > regression=# do $$ > regression$# declare r record; > regression$# begin > regression$# raise notice '%', r; > regression$# end$$; > ERROR: record "r" is not assigned yet > DETAIL: The tuple structure of a

Re: Allowing SSL connection of v11 client to v10 server with SCRAM channel binding

2017-12-08 Thread Michael Paquier
On Sat, Dec 9, 2017 at 12:23 AM, Peter Eisentraut wrote: > On 12/1/17 18:11, Michael Paquier wrote: >> Cool. Thanks. For REL_10_STABLE, I would suggest the attached patch >> then. This ensures that eSws is checked in the final message and that >> the cbind-flag

plpgsql fails to reinitialize record variables at block re-entry

2017-12-08 Thread Tom Lane
Consider regression=# do $$ regression$# declare r record; regression$# begin regression$# raise notice '%', r; regression$# end$$; ERROR: record "r" is not assigned yet DETAIL: The tuple structure of a not-yet-assigned record is indeterminate. CONTEXT: SQL statement "SELECT r" PL/pgSQL

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Rok Kralj
Most popular questions on every topic are the simplest ones. Imagine a parallel universe where this patch is contained in the codebase - I argue this question about exiting the repl still is the top one, albeit with less votes. On Sat, Dec 9, 2017, 11:03 Michael Paquier

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Michael Paquier
On Sat, Dec 9, 2017 at 3:56 AM, Robert Haas wrote: > On Fri, Dec 8, 2017 at 8:57 AM, Daniel Vérité" > wrote: >> When looking at the most popular postgres questions on stackoverflow: >> >>

Re: Speeding up pg_upgrade

2017-12-08 Thread Bruce Momjian
On Fri, Dec 8, 2017 at 12:26:55PM -0500, Stephen Frost wrote: > Bruce, > > * Bruce Momjian (br...@momjian.us) wrote: > > I think the big problem with two-stage pg_upgrade is that the user steps > > are more complex, so what percentage of users are going use the > > two-stage method. The bad

Re: [HACKERS] Re: proposal - psql: possibility to specify sort for describe commands, when size is printed

2017-12-08 Thread Pavel Stehule
2017-12-08 22:49 GMT+01:00 Alexander Korotkov : > Hi! > > On Mon, Nov 27, 2017 at 10:18 PM, Pavel Stehule > wrote: > >> I though about this design more time. I see following disadvantages >> >> 1. we are not able to check all possible variants

Re: Add %r substitution for psql prompts to show recovery status

2017-12-08 Thread Alexander Korotkov
On Fri, Dec 8, 2017 at 3:54 AM, Tatsuo Ishii wrote: > > On Wed, Dec 6, 2017 at 9:19 PM, Ian Barwick > wrote: > >> Note this substitution sends a "pg_is_in_recovery()" query to the server > >> each time it's encountered; unless there's something

Re: Postgres with pthread

2017-12-08 Thread konstantin knizhnik
On Dec 7, 2017, at 10:41 AM, Simon Riggs wrote: >> But it is a theory. The main idea of this prototype was to prove or disprove >> this expectation at practice. > >> But please notice that it is very raw prototype. A lot of stuff is not >> working yet. > >> And supporting all of exited

Re: Partition pruning for Star Schema

2017-12-08 Thread legrand legrand
Thank You ! I will monitor this 'runtime partition pruning' patch. This will be better than using Partitioned DIM tables "Partion wise joined" with a multi level partitioned FACT table ;o) Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

Re: Postgres with pthread

2017-12-08 Thread Alexander Korotkov
On Sat, Dec 9, 2017 at 1:09 AM, konstantin knizhnik < k.knizh...@postgrespro.ru> wrote: > I am not going to show stack traces of all 1000 threads. > But you may notice that proc array lock really seems be be a bottleneck. > Yes, proc array lock easily becomes a bottleneck on multicore machine

Re: CUBE seems a bit confused about ORDER BY

2017-12-08 Thread Alexander Korotkov
Hi! On Fri, Dec 8, 2017 at 11:21 AM, Andrey Borodin wrote: > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: tested, passed >

Re: explain analyze output with parallel workers - question about meaning of information for explain.depesz.com

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 5:11 AM, Amit Kapila wrote: >> Okay, I have adjusted the patch accordingly. I have also added a >> regression test which should produce the same result across different >> runs, see if that looks okay to you, then it is better to add such a >> test

Re: [HACKERS] Custom compression methods

2017-12-08 Thread Robert Haas
On Wed, Dec 6, 2017 at 10:07 AM, Ildus Kurbangaliev wrote: > On Fri, 1 Dec 2017 21:47:43 +0100 > Tomas Vondra wrote: >> +1 to do the rewrite, just like for other similar ALTER TABLE commands > > Ok. What about the following syntax: > >

Re: [HACKERS] postgres_fdw bug in 9.6

2017-12-08 Thread Robert Haas
On Sun, Dec 3, 2017 at 2:56 PM, Tom Lane wrote: > Not sure where that leaves us for the patch at hand. It feels to me > like it's a temporary band-aid for code that we want to get rid of > in the not-too-long run. As such, it'd be okay if it were smaller, > but it seems