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 not-yet-assigned record is indetermi

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 wrote: > On Sat, Dec 9, 2

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 funct

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 of extended query. If >> there will be some custom er

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: >> >> https://stackoverflow.com/questions/tagged/postgresql?sort=votes >> >> the first one (most up-voted) happens

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 news

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. + (errcode(E

Leftover reference to replacement selection 1 run case

2017-12-08 Thread Peter Geoghegan
While reviewing the parallel CREATE INDEX patch, I noticed that commit 8b304b8b omitted to remove a comment that it made obsolete. Attached patch removes the comment. -- Peter Geoghegan From a52ca388cb21f797bcfe3a1b15cc9168e5d26f41 Mon Sep 17 00:00:00 2001 From: Peter Geoghegan Date: Fri, 8 Dec

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: http://www.po

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 sent in the first message maps with

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 > Documentation:teste

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 wit

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 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 Postgres

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 I'm overlooking I > >> think that's the only reliab

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

2017-12-08 Thread 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 of extended query. If > there will be some custom error, then we will raise pretty ugly error > messages, > Yes,

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 vers

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 of whether it > > works. In the case of a standby

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". This fact table is partitionne

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 bigger and more invasive

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: > > ALTER COLUMN DROP COMPRESSION - removes compression from 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: >> 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 as well. > > The regressi

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. T

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

2017-12-08 Thread Tom Lane
Andres Freund writes: > 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

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

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: 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 2:22 PM, Thomas Munro wrote: > On Sat, Dec 9, 2017 at 6:42 AM, Robert Haas wrote: >> 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 t

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 entirely when > not in a continuation line, an

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

2017-12-08 Thread Thomas Munro
On Sat, Dec 9, 2017 at 6:42 AM, Robert Haas wrote: > 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 ca

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 arguably the biggest

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 of user-friendly sof

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: >> >> https://stackoverflow.com/questions/tagged/postgresql?sort=votes >> >> the first one (most up-voted) happen

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Tom Lane
Robert Haas writes: > 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 PostgreS

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 PostgreSQL command line utility:

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); > create table p1 partition of p fo

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 awesome? :-) -- Robert Haas E

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 u

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 session-level >> lock. Please review it. > > +

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 complex, so what percentage of users a

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 bad news is that o

Re: Speeding up pg_upgrade

2017-12-08 Thread Mark Dilger
> On Dec 7, 2017, at 10:24 PM, Bruce Momjian wrote: > > On Thu, Dec 7, 2017 at 10:37:30AM -0500, Stephen Frost wrote: >> Alexander, >> >> * Alexander Kukushkin (cyberd...@gmail.com) wrote: >>> Couple of months ago we at Zalando upgraded a few databases of different >>> sizes to 9.6. >> >> Tha

Re: Out of date comment in cached_plan_cost

2017-12-08 Thread Robert Haas
On Thu, Dec 7, 2017 at 3:14 AM, David Rowley wrote: > I just noticed a comment which has been made a little outdated by the > partition-wise join code from commit f49842d1. The comment claims that > inheritance children don't add to the effort required in join > planning, while that still may be t

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 > --- a/doc/src/sgml/monitoring.sgml > +++ b

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 struggled with how to quit >> psql. I felt that making people look up how

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 of patch takes care

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 that exiting the program is a special case that mer

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: [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( > WaitForParallelWorkersToExit->WaitForBackgroundWork

Re: [HACKERS] Runtime Partition Pruning

2017-12-08 Thread Robert Haas
On Thu, Dec 7, 2017 at 2:22 AM, Beena Emerson wrote: > I have added the partition quals that are used for pruning. > > PFA the updated patch. I have changed the names of variables to make > it more appropriate, along with adding more code comments and doing > some refactoring and other code cleanu

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread David G. Johnston
On Fri, Dec 8, 2017 at 8:19 AM, Tom Lane wrote: > "David G. Johnston" writes: > A psql novice is unlikely > to be familiar with that concept, let alone know that \r or ^C is the > way to get there. There's a weak argument that "help" is of some > value because it's likely to be the first thing

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Szymon Lipiński
On 8 December 2017 at 15:34, Oliver Ford wrote: > 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. > >

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: How to use set/reset role in contrib_regression test?

2017-12-08 Thread Jeremy Finzel
Here is my version: PostgreSQL 9.6.6 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit Indeed it is possible my extension is messing up the behavior because event triggers are firing on the CREATE events. But there is no SET ROLE happening in the event triggers. Perhaps one

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread Tom Lane
"David G. Johnston" writes: > I'll agree that exiting the program is a special case that merits > consideration - and it has been given that in the form of the concession to > the word "help" in order to get the reader unfamiliar with our backslash > prefix a non-backslash way to obtain that knowl

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".​ >> >> For example, while I thin

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread David G. Johnston
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 struggled with how to quit > psql. I felt that making people look up how to quit the program is bad > UI design. I admired Postgres as a dat

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 th

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

2017-12-08 Thread Tom Lane
Rui Hai Jiang writes: > When I run a select query, e.g. select id from t, all columns in table "t" > are checked to see if a column named "id" exists or not, and a Var is created > for "id" if the column does exist. > Function scanRTEForColumn() does this job. > But I see in scanRTEForColumn(

Re: proposal: alternative psql commands quit and exit

2017-12-08 Thread David G. Johnston
On Fri, Dec 8, 2017 at 7:26 AM, Everaldo Canuto wrote: > Didn't know about SHOW command. Are TABLES a reserved word? > ​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

Re: How to use set/reset role in contrib_regression test?

2017-12-08 Thread Tom Lane
Michael Paquier writes: > Per the information you are giving, I would have seen "popo2" as user > for the last query even after issuing a RESET ROLE. However I do not > see any problems. Yeah, I also failed to reproduce it (on yesterday's HEAD, though I'd be surprised if older versions were buste

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 are falling into the misimpression

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 "exit" and MySQL client can be

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 that list is "PostgreSQL

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 alr

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: https://stackoverflow.com/q

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 Postgres. People! I'm definitely +

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 kind of > information)

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] 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 Sub

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 seems very hacky and would > lead > > to misunderstandings. I

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 clients to implement "\q" and "\q

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 valu

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 above [1]) >>> which fixes it such that it will resemble the non-parallel cas

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 good. > > And remember, mysql

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 implement in the same way help

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: [HACKERS] parallel.c oblivion of worker-startup failures

2017-12-08 Thread Amit Kapila
On Wed, Dec 6, 2017 at 8:02 PM, Robert Haas wrote: > On Wed, Dec 6, 2017 at 1:43 AM, Amit Kapila wrote: >> Looks good to me. > > Committed and back-patched to 9.4 where dynamic background workers > were introduced. > Thanks. >>> Barring objections, I'll commit and >>> back-patch this; then we c

Incorrect debug info printed in generate_partition_wise_join_paths

2017-12-08 Thread Etsuro Fujita
generate_partition_wise_join_paths prints debug info, if OPTIMIZER_DEBUG, using debug_print_rel at the end of each iteration for collecting non-dummy child-joins, but I noticed that we pass to that function the parent's RelOptInfo, not such a child-join's RelOptInfo. I don't think it's intentional

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 output of the local scan on public

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: >> > 0001-Add-parallel-B-tree-index-build-sorting_v14.patch I've looked only at p

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 we allow interrupts bef

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 Sawada >>> wrote: Thank you for comments. Attached updated patch. >>> >>

Re: CUBE seems a bit confused about ORDER BY

2017-12-08 Thread Andrey Borodin
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hi! I've reviewed the patch. Patch works as expected, documen

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

2017-12-08 Thread Masahiko Sawada
On Sat, Dec 2, 2017 at 3:28 AM, Robert Haas wrote: > On Fri, Dec 1, 2017 at 10:14 AM, Masahiko Sawada > wrote: >> The patched is 10 times faster than current HEAD. > > Nifty. Thank you for your dedicated reviewing the patch. > The first hunk in monitoring.sgml looks unnecessary. You meant the

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 != ThisTimeLineID; > > > > I was facing another issue. > > On