Re: Removal of duplicate variable declarations in fe-connect.c

2019-02-21 Thread Haribabu Kommi
On Fri, Feb 22, 2019 at 3:22 PM Michael Paquier wrote: > On Fri, Feb 22, 2019 at 11:33:17AM +1100, Haribabu Kommi wrote: > > During the development of another feature, I found that same local > > variables are declared twice. > > IMO, there is no need of again declaring the local variables.

Re: Libpq support to connect to standby server as priority

2019-02-21 Thread Haribabu Kommi
On Fri, Feb 22, 2019 at 5:47 PM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Haribabu Kommi [mailto:kommi.harib...@gmail.com] > Here I attached first set of patches that implemented the prefer-read > option > > after reporting the transaction_read_only GUC to client. Along

RE: Libpq support to connect to standby server as priority

2019-02-21 Thread Tsunakawa, Takayuki
From: Haribabu Kommi [mailto:kommi.harib...@gmail.com] Here I attached first set of patches that implemented the prefer-read option > after reporting the transaction_read_only GUC to client. Along the lines > of adding prefer-read option patch, Great, thank you! I'll review and test it. > 3.

RE: Problem during Windows service start

2019-02-21 Thread Tsunakawa, Takayuki
Hi Higuchi-san, (1) What made you think this problem rarely occurs in PG 10 or later? Looking at the following code, this seems to happen in PG 10+ too. if (do_wait) { write_eventlog(EVENTLOG_INFORMATION_TYPE, _("Waiting for server startup...\n")); if

Re: Libpq support to connect to standby server as priority

2019-02-21 Thread Haribabu Kommi
On Thu, Feb 14, 2019 at 1:04 PM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Haribabu Kommi [mailto:kommi.harib...@gmail.com] > > No. It's not good if the user has to be bothered by > > default_transaction_read_only when he simply wants to a standby. > > > > > > > >

Re: [HACKERS] Restricting maximum keep segments by repslots

2019-02-21 Thread Kyotaro HORIGUCHI
At Fri, 22 Feb 2019 10:12:51 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20190222.101251.0542.horiguchi.kyot...@lab.ntt.co.jp> horiguchi.kyotaro> At Fri, 15 Feb 2019 19:13:23 -0800, Andres Freund wrote in <20190216031323.t7tfrae4l6zqt...@alap3.anarazel.de> > > Maybe I'm

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2019-02-21 Thread Michael Paquier
On Fri, Feb 22, 2019 at 02:38:56AM +, Tsunakawa, Takayuki wrote: > From: Julien Rouhaud [mailto:rjuju...@gmail.com] >> FWIW, I prefer shrink over truncate, though I'd rather go with >> vacuum_shink_enabled as suggested previously. > > Thanks. I'd like to leave a committer to choose the name.

Re: Using old master as new replica after clean switchover

2019-02-21 Thread Michael Paquier
On Thu, Feb 21, 2019 at 10:26:37AM -0800, RSR999GMAILCOM wrote: > Is there any link where the required setup and the step by step procedure > for performing the controlled switchover are listed? Docs about failover are here: https://www.postgresql.org/docs/current/warm-standby-failover.html Now

Re: Using old master as new replica after clean switchover

2019-02-21 Thread Michael Paquier
On Thu, Feb 21, 2019 at 03:38:21PM -0300, Claudio Freire wrote: > If I'm not mistaken, if you don't have WAL archive set up (a shared > filesystem isn't necessary, but the standby has to be able to restore > WAL segments from the archive), a few transactions that haven't been > streamed at primary

Re: Removal of duplicate variable declarations in fe-connect.c

2019-02-21 Thread Michael Paquier
On Fri, Feb 22, 2019 at 11:33:17AM +1100, Haribabu Kommi wrote: > During the development of another feature, I found that same local > variables are declared twice. > IMO, there is no need of again declaring the local variables. Patch > attached. Indeed, fixed. That's not a good practice, and

Unified security key managment

2019-02-21 Thread Bruce Momjian
I know there has been recent discussion about implementing transparent data encryption (TDE) in Postgres: https://www.postgresql.org/message-id/CAD21AoAqtytk0iH6diCJW24oyJdS4roN-VhrFD53HcNP0s8pzA%40mail.gmail.com I would like to now post a new extension I developed to handle

Re: WIP: Avoid creation of the free space map for small tables

2019-02-21 Thread Amit Kapila
On Fri, Feb 22, 2019 at 1:57 AM Alvaro Herrera wrote: > > I think this test is going to break on nonstandard block sizes. While > we don't promise that all tests work on such installs (particularly > planner ones), > The reason for not pushing much on making the test pass for nonstandard block

RE: reloption to prevent VACUUM from truncating empty pages at the end of relation

2019-02-21 Thread Tsunakawa, Takayuki
From: Julien Rouhaud [mailto:rjuju...@gmail.com] > FWIW, I prefer shrink over truncate, though I'd rather go with > vacuum_shink_enabled as suggested previously. Thanks. I'd like to leave a committer to choose the name. FWIW, I chose shrink_enabled rather than vacuum_shrink_enabled because

RE: Timeout parameters

2019-02-21 Thread Tsunakawa, Takayuki
From: Jamison, Kirk [mailto:k.jami...@jp.fujitsu.com] > socket_timeout (integer) libpq documentation does not write the data type on the parameter name line. > Terminate any connection that has been inactive for more than the specified > number of seconds to prevent client from infinite waiting

RE: libpq debug log

2019-02-21 Thread Jamison, Kirk
On Wednesday, February 20, 2019 12:56 PM GMT+9, Robert Haas wrote: > On Mon, Feb 18, 2019 at 10:06 PM Jamison, Kirk > wrote: > > It sounds more logical to me if there is a parameter that switches > > on/off the logging similar to other postgres logs. I suggest trace_log as > > the parameter

Re: pg_dump multi VALUES INSERT

2019-02-21 Thread David Rowley
On Tue, 19 Feb 2019 at 02:34, Surafel Temesgen wrote: > I see that there are already a test for zero column table in > test_fourth_table_zero_col > and if am not wrong table_index_stats is empty table Maybe Fabien would like to see a test that dumps that table with --rows-per-insert= to ensure

RE: Timeout parameters

2019-02-21 Thread Jamison, Kirk
On Friday, February 22, 2019 9:46 AM (GMT+9), Tsunakawa, Takayuki wrote: > > Terminate any session that has been idle for more than the > > specified number of seconds to prevent client from infinite > > waiting for server due to dead connection. This can be used both as a > > brute force

Re: [HACKERS] Restricting maximum keep segments by repslots

2019-02-21 Thread Kyotaro HORIGUCHI
At Fri, 15 Feb 2019 19:13:23 -0800, Andres Freund wrote in <20190216031323.t7tfrae4l6zqt...@alap3.anarazel.de> > Hi, > > On 2019-01-30 10:42:04 +0900, Kyotaro HORIGUCHI wrote: > > From 270aff9b08ced425b4c4e23b53193285eb2359a6 Mon Sep 17 00:00:00 2001 > > From: Kyotaro Horiguchi > > Date: Thu,

RE: Timeout parameters

2019-02-21 Thread Tsunakawa, Takayuki
From: mikalaike...@ibagroup.eu [mailto:mikalaike...@ibagroup.eu] > I am not very familiar with the PostgreSQL source code. Nevertheless, the > main idea of this parameter is clear for me - closing a connection when > the PostgreSQL server does not response due to any reason. However, I have >

Re: bgwriter_lru_maxpages limits in PG 10 sample conf

2019-02-21 Thread Bruce Momjian
On Wed, Feb 20, 2019 at 11:54:25PM +0300, Sergei Kornilov wrote: > Hello > > > I'm a bit reluctant to whack postgresql.conf around in back-branches > > because sometimes that makes funny things happen when somebody > > upgrades, e.g. via RPM. > > If i remember correctly both deb and rpm packages

RE: libpq debug log

2019-02-21 Thread Iwata, Aya
Hi Robert, > I'm not really sure that I like the design of this patch in any way. Aside from problems with my current documentation which I will fix, could you explain more detail about the problem of the design? I would like to improve my current implementation based from feedback. Regards,

RE: Timeout parameters

2019-02-21 Thread Tsunakawa, Takayuki
From: Jamison, Kirk/ジャミソン カーク > Although I did review and followed the suggested way in previous email > way back (which uses root user) and it worked as intended, I'd also like > to hear feedback also from Fabien whether it's alright without the test > script, or if there's another way we can

Re: proposal: variadic argument support for least, greatest function

2019-02-21 Thread Chapman Flack
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:tested, passed On 02/21/19 16:04, Tom Lane wrote: > Pavel Stehule writes: >> I

Removal of duplicate variable declarations in fe-connect.c

2019-02-21 Thread Haribabu Kommi
Hi Hackers, During the development of another feature, I found that same local variables are declared twice. IMO, there is no need of again declaring the local variables. Patch attached. Regards, Haribabu Kommi Fujitsu Australia 0001-Removal-of-duplicate-local-variable-declaration.patch

Re: boolean and bool in documentation

2019-02-21 Thread Tom Lane
Bruce Momjian writes: > On Tue, Feb 19, 2019 at 12:56:19AM +0900, Masahiko Sawada wrote: >> AFAICS there seems not to be explicit rules and policies for usage of >> 'boolean' and 'bool'. We use 'bool' for colum data type of almost >> system catalogs but use 'boolean' for some catalogs

RE: Timeout parameters

2019-02-21 Thread Jamison, Kirk
Hi, > > tcp_socket_timeout (integer) > > > > Terminate and restart any session that has been idle for more than > > the specified number of milliseconds to prevent client from infinite > > waiting for server due to dead connection. This can be used both as > > a brute force global query timeout

Re: Removing unneeded self joins

2019-02-21 Thread Tom Lane
Alexander Kuzmenkov writes: > Here is a rebased version with some bugfixes. I noticed this had bit-rotted again. I've not really reviewed it, but I rebased it up to HEAD, and fixed a couple small things: * My compiler was bitching about misplaced declarations, so I moved some variable

Re: boolean and bool in documentation

2019-02-21 Thread Bruce Momjian
On Tue, Feb 19, 2019 at 12:56:19AM +0900, Masahiko Sawada wrote: > AFAICS there seems not to be explicit rules and policies for usage of > 'boolean' and 'bool'. We use 'bool' for colum data type of almost > system catalogs but use 'boolean' for some catalogs (pg_pltemplate and > pg_policy). The

Optimization of some jsonb functions

2019-02-21 Thread Nikita Glukhov
Attached set of patches with some jsonb optimizations that were made during comparison of performance of ordinal jsonb operators and jsonpath operators. 1. Optimize JsonbExtractScalar(): It is better to use getIthJsonbValueFromContainer(cont, 0) instead of JsonIterator to get 0th element

Re: proposal: variadic argument support for least, greatest function

2019-02-21 Thread Chapman Flack
On 02/21/19 11:31, Pavel Stehule wrote: > I wrote doc (just one sentence) and minimal test. Both can be enhanced. Attaching minmax_variadic-20190221b.patch, identical but for s/supports/support/ and s/a/an/ in the doc. Regards, -Chap diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml

Re: [PATCH v20] GSSAPI encryption support

2019-02-21 Thread Stephen Frost
Greetings, * Robbie Harwood (rharw...@redhat.com) wrote: > Stephen Frost writes: > > * Robbie Harwood (rharw...@redhat.com) wrote: > >> Sure! I'll go ahead and hack up the checks and lucid stuff and get > >> back to you. > > > > Great! I'll finish fleshing out the basics of how to have this

Re: psql show URL with help

2019-02-21 Thread David Fetter
On Thu, Feb 21, 2019 at 06:28:09PM +0100, Peter Eisentraut wrote: > As mentioned on > > https://www.cybertec-postgresql.com/en/looking-at-mysql-8-with-postgresql-goggles-on/ > > how about this: > > => \h analyze > Command: ANALYZE > Description: collect statistics about a database > Syntax:

Re: Vectors instead of lists, specialised qsort(), binary_search(), unique()

2019-02-21 Thread Thomas Munro
On Thu, Feb 21, 2019 at 7:27 PM David Rowley wrote: > As for the ArrayList patch that I'd been working on, I was a bit > blocked on it due to Tom's comment in [1], after having quickly looked > over your patch I see there's no solution for that complaint. > > (I'd been trying to think of a

Re: Protect syscache from bloating with negative cache entries

2019-02-21 Thread 'Bruce Momjian'
On Tue, Feb 19, 2019 at 07:08:14AM +, Tsunakawa, Takayuki wrote: > We all have to manage things within resource constraints. The DBA > wants to make sure the server doesn't overuse memory to avoid crash > or slowdown due to swapping. Oracle does it, and another open source > database, MySQL,

Re: [PATCH v20] GSSAPI encryption support

2019-02-21 Thread Robbie Harwood
Stephen Frost writes: > * Robbie Harwood (rharw...@redhat.com) wrote: >> Stephen Frost writes: >>> * Robbie Harwood (rharw...@redhat.com) wrote: Stephen Frost writes: > * Robbie Harwood (rharw...@redhat.com) wrote: > >> Attached please find version 20 of the GSSAPI encryption

Re: [patch] Add schema total size to psql \dn+

2019-02-21 Thread Gilles Darold
Le 21/02/2019 à 21:57, Jerry Sievers a écrit : > Gilles Darold writes: > >> Le 21/02/2019 à 18:28, Julien Rouhaud a écrit : >> >>> On Thu, Feb 21, 2019 at 5:42 PM Gilles Darold >>> wrote: Le 21/02/2019 à 12:01, Julien Rouhaud a écrit : > On Thu, Feb 21, 2019 at 11:49 AM Gilles Darold

Re: proposal: variadic argument support for least, greatest function

2019-02-21 Thread Tom Lane
David Fetter writes: > On Thu, Feb 21, 2019 at 04:04:41PM -0500, Tom Lane wrote: >> I still say we should reject this and invent array_greatest/array_least >> functions instead. > Might other array_* functions of this type be in scope for this patch? Uh ... no, I wouldn't expect that. Why

Re: proposal: variadic argument support for least, greatest function

2019-02-21 Thread David Fetter
On Thu, Feb 21, 2019 at 04:04:41PM -0500, Tom Lane wrote: > I still say we should reject this and invent array_greatest/array_least > functions instead. Might other array_* functions of this type be in scope for this patch? Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778

Re: proposal: variadic argument support for least, greatest function

2019-02-21 Thread Tom Lane
Pavel Stehule writes: > čt 21. 2. 2019 v 3:20 odesílatel Chapman Flack > napsal: >> I am not sure I have an answer to the objections being raised on grounds >> of taste. To me, it's persuasive that GREATEST and LEAST are described in >> the docco as functions, they are used much like variadic

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2019-02-21 Thread David Rowley
On Tue, 5 Feb 2019 at 01:54, Robert Haas wrote: > > On Mon, Feb 4, 2019 at 12:02 AM David Rowley > wrote: > > If the PartitionDesc from the parallel worker has an extra partition > > than what was there when the plan was built then the partition index > > to subplan index translation will be

Re: [patch] Add schema total size to psql \dn+

2019-02-21 Thread Jerry Sievers
Gilles Darold writes: > Le 21/02/2019 à 18:28, Julien Rouhaud a écrit : > >> On Thu, Feb 21, 2019 at 5:42 PM Gilles Darold >> wrote: >>> Le 21/02/2019 à 12:01, Julien Rouhaud a écrit : On Thu, Feb 21, 2019 at 11:49 AM Gilles Darold wrote: >> When we want to get total size of

Re: NOT IN subquery optimization

2019-02-21 Thread David Rowley
On Thu, 21 Feb 2019 at 16:27, Jim Finnerty wrote: > We can always correctly transform a NOT IN to a correlated NOT EXISTS. In > almost all cases it is more efficient to do so. In the one case that we've > found that is slower it does come down to a more general costing issue, so > that's

Re: WIP: Avoid creation of the free space map for small tables

2019-02-21 Thread Alvaro Herrera
I think this test is going to break on nonstandard block sizes. While we don't promise that all tests work on such installs (particularly planner ones), it seems fairly easy to cope with this one -- just use a record size expressed as a fraction of current_setting('block_size'). So instead of

Re: [HACKERS] WIP: Aggregation push-down

2019-02-21 Thread Tom Lane
Antonin Houska writes: > Michael Paquier wrote: >> Latest patch set fails to apply, so moved to next CF, waiting on >> author. > Rebased. This is in need of rebasing again :-(. I went ahead and pushed the 001 part, since that seemed fairly uncontroversial. (Note that I changed

Re: Delay locking partitions during INSERT and UPDATE

2019-02-21 Thread David Rowley
On Fri, 22 Feb 2019 at 05:33, Robert Haas wrote: > > On Wed, Feb 20, 2019 at 4:56 PM David Rowley > wrote: > > I've made a pass over this again and updated the header comments in > > functions that now obtain a lock to mention that fact. > > Thanks. I have committed this version. I know Tomas

Re: [patch] Add schema total size to psql \dn+

2019-02-21 Thread Gilles Darold
Le 21/02/2019 à 18:28, Julien Rouhaud a écrit : > On Thu, Feb 21, 2019 at 5:42 PM Gilles Darold > wrote: >> Le 21/02/2019 à 12:01, Julien Rouhaud a écrit : >>> On Thu, Feb 21, 2019 at 11:49 AM Gilles Darold >>> wrote: > When we want to get total size of all relation in a schema we have to

Re: restrict pg_stat_ssl to superuser?

2019-02-21 Thread Peter Eisentraut
On 2019-02-21 09:11, Michael Paquier wrote: > On Wed, Feb 20, 2019 at 11:51:08AM +0100, Peter Eisentraut wrote: >> So here is a patch doing it the "normal" way of nulling out all the rows >> the user shouldn't see. > > That looks fine to me. Committed, thanks. >> I haven't found any

Re: Compressed TOAST Slicing

2019-02-21 Thread Paul Ramsey
On Wed, Feb 20, 2019 at 1:12 PM Stephen Frost wrote: > > * Paul Ramsey (pram...@cleverelephant.ca) wrote: > > On Wed, Feb 20, 2019 at 10:50 AM Daniel Verite > > wrote: > > > > > > What about starts_with(string, prefix)? > > Thanks, I'll add that. > > That sounds good to me, I look forward to an

Re: Using old master as new replica after clean switchover

2019-02-21 Thread Claudio Freire
On Tue, Feb 19, 2019 at 9:44 PM Michael Paquier wrote: > > On Tue, Feb 19, 2019 at 04:27:02PM -0800, RSR999GMAILCOM wrote: > > So wanted to clarify if this procedure really requires the WAL archive > > location on a shared storage ? > > Shared storage for WAL archives is not a requirement. It

Re: [PROPOSAL] Shared Ispell dictionaries

2019-02-21 Thread Andres Freund
On February 21, 2019 10:08:00 AM PST, Tom Lane wrote: >Robert Haas writes: >> Perhaps a better approach still would be to do what Andres proposed >> back in March: > >> #> Is there any chance we can instead can convert dictionaries into a >form >> #> we can just mmap() into memory? That'd

Re: Using old master as new replica after clean switchover

2019-02-21 Thread RSR999GMAILCOM
Is there any link where the required setup and the step by step procedure for performing the controlled switchover are listed? Thanks Raj On Tue, Feb 19, 2019 at 4:44 PM Michael Paquier wrote: > On Tue, Feb 19, 2019 at 04:27:02PM -0800, RSR999GMAILCOM wrote: > > So wanted to clarify if this

Re: [PROPOSAL] Shared Ispell dictionaries

2019-02-21 Thread Tom Lane
Robert Haas writes: > Perhaps a better approach still would be to do what Andres proposed > back in March: > #> Is there any chance we can instead can convert dictionaries into a form > #> we can just mmap() into memory? That'd scale a lot higher and more > #> dynamicallly? That seems awfully

Re: psql show URL with help

2019-02-21 Thread Julien Rouhaud
On Thu, Feb 21, 2019 at 6:33 PM Pavel Stehule wrote: > > čt 21. 2. 2019 v 18:28 odesílatel Peter Eisentraut > napsal: >> >> As mentioned on >> >> https://www.cybertec-postgresql.com/en/looking-at-mysql-8-with-postgresql-goggles-on/ >> >> how about this: >> >> => \h analyze >> Command:

Re: psql show URL with help

2019-02-21 Thread Pavel Stehule
čt 21. 2. 2019 v 18:28 odesílatel Peter Eisentraut < peter.eisentr...@2ndquadrant.com> napsal: > As mentioned on > > > https://www.cybertec-postgresql.com/en/looking-at-mysql-8-with-postgresql-goggles-on/ > > how about this: > > => \h analyze > Command: ANALYZE > Description: collect

Re: [patch] Add schema total size to psql \dn+

2019-02-21 Thread Julien Rouhaud
On Thu, Feb 21, 2019 at 5:42 PM Gilles Darold wrote: > > Le 21/02/2019 à 12:01, Julien Rouhaud a écrit : > > On Thu, Feb 21, 2019 at 11:49 AM Gilles Darold > > wrote: > >>> When we want to get total size of all relation in a schema we have to > >>> execute one of our favorite DBA query. It is

psql show URL with help

2019-02-21 Thread Peter Eisentraut
As mentioned on https://www.cybertec-postgresql.com/en/looking-at-mysql-8-with-postgresql-goggles-on/ how about this: => \h analyze Command: ANALYZE Description: collect statistics about a database Syntax: ANALYZE [ ( option [, ...] ) ] [ table_and_columns [, ...] ] ANALYZE [ VERBOSE ] [

Re: list append syntax for postgresql.conf

2019-02-21 Thread Robert Haas
On Wed, Feb 20, 2019 at 10:15 AM Peter Eisentraut wrote: > Nowadays there are a number of methods for composing multiple > postgresql.conf files for modularity. But if you have a bunch of things > you want to load via shared_preload_libraries, you have to put them all > in one setting. How

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2019-02-21 Thread Robert Haas
On Mon, Feb 4, 2019 at 12:54 PM Robert Haas wrote: > On Mon, Feb 4, 2019 at 12:02 AM David Rowley > wrote: > > If the PartitionDesc from the parallel worker has an extra partition > > than what was there when the plan was built then the partition index > > to subplan index translation will be

Re: Unnecessary checks for new rows by some RI trigger functions?

2019-02-21 Thread Tom Lane
Robert Haas writes: > On Wed, Feb 20, 2019 at 9:27 AM Antonin Houska wrote: >> However I find it confusing that the trigger functions pass >> detectNewRows=true >> even if they only execute SELECT statement. > I don't quite see what those two things have to do with each other, > but I might be

Re: [patch] Add schema total size to psql \dn+

2019-02-21 Thread Gilles Darold
Le 21/02/2019 à 12:01, Julien Rouhaud a écrit : > On Thu, Feb 21, 2019 at 11:49 AM Gilles Darold > wrote: >>> When we want to get total size of all relation in a schema we have to >>> execute one of our favorite DBA query. It is quite simple but what >>> about displaying schema size when using

Re: ToDo: show size of partitioned table

2019-02-21 Thread Pavel Stehule
čt 21. 2. 2019 v 0:56 odesílatel Justin Pryzby napsal: > On Sat, Feb 16, 2019 at 10:52:35PM +0100, Pavel Stehule wrote: > > I like your changes. I merged all - updated patch is attached > > I applied and tested your v10 patch. > > Find attached some light modifications. > I have not any

Re: Delay locking partitions during INSERT and UPDATE

2019-02-21 Thread Tomas Vondra
On 2/21/19 5:33 PM, Robert Haas wrote: > On Wed, Feb 20, 2019 at 4:56 PM David Rowley > wrote: >> I've made a pass over this again and updated the header comments in >> functions that now obtain a lock to mention that fact. > > Thanks. I have committed this version. I know Tomas Vondra was >

Re: Delay locking partitions during INSERT and UPDATE

2019-02-21 Thread Robert Haas
On Wed, Feb 20, 2019 at 4:56 PM David Rowley wrote: > I've made a pass over this again and updated the header comments in > functions that now obtain a lock to mention that fact. Thanks. I have committed this version. I know Tomas Vondra was planning to do that, but it's been close to a month

Re: proposal: variadic argument support for least, greatest function

2019-02-21 Thread Pavel Stehule
Hi čt 21. 2. 2019 v 3:20 odesílatel Chapman Flack napsal: > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: not tested > Documentation:not

Re: [PROPOSAL] Shared Ispell dictionaries

2019-02-21 Thread Robert Haas
On Thu, Feb 21, 2019 at 8:28 AM Arthur Zakirov wrote: > Your approach looks simpler. It is necessary just to periodically scan > dictionaries' cache hash table and not call dsm_pin_segment() when a DSM > segment initialized. It also means that a dictionary is loaded into DSM > only while there is

Re: libpq host/hostaddr/conninfo inconsistencies

2019-02-21 Thread Robert Haas
On Thu, Feb 21, 2019 at 10:57 AM Tom Lane wrote: > True, but isn't that because we fail to document at all that you > can put an IP address in "host"? Which your proposed patch didn't > change, IIRC. Well, that's another way to tackle the problem. Personally, I see pretty much no downside in

Re: libpq host/hostaddr/conninfo inconsistencies

2019-02-21 Thread Tom Lane
Robert Haas writes: > From my point of view, the issue here is that the way the > documentation is written right now tends to lead people to believe > that if they have a host name, they must pass it via host, and if they > have an IP address, they must pass it via hostaddr. Thus pgAdmin 3, > at

Re: libpq host/hostaddr/conninfo inconsistencies

2019-02-21 Thread Tom Lane
Fabien COELHO writes: > However, it does not discuss that an IP can (and should, IMHO) be given > through "host" if the point is to specify the target by its IP rather than > a lookup shortcut. Ah, that's the crux of the problem. There are two ways that you could consider to be "best

Re: libpq host/hostaddr/conninfo inconsistencies

2019-02-21 Thread Robert Haas
On Thu, Feb 21, 2019 at 10:33 AM Tom Lane wrote: > Sure, you only need it if you want to bypass DNS lookup, but if you > do that, you don't necessarily need to give "host" as well. Changing > the documentation to imply that you do would not be an improvement. >From my point of view, the issue

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2019-02-21 Thread Kuntal Ghosh
Hello Pavan, Thank you for the patch. It seems to me that while performing COPY FREEZE, if we've copied tuples in a previously emptied page, we can set the PageSetAllVisible(page) in heap_muli_insert only. Something like, bool init = (ItemPointerGetOffsetNumber(&(heaptuples[ndone]->t_self)) ==

Re: libpq host/hostaddr/conninfo inconsistencies

2019-02-21 Thread Tom Lane
Fabien COELHO writes: >> My only complaint about this is that it makes it sound like you *must* >> provide "host", even when giving "hostaddr": > That is the idea, "hostaddr" is moslty never needed. Sure, you only need it if you want to bypass DNS lookup, but if you do that, you don't

Re: Journal based VACUUM FULL

2019-02-21 Thread Andreas Karlsson
On 2/21/19 12:16 AM, Ryan David Sheasby wrote: I was reading on VACUUM and VACUUM FULL and saw that the current implementation of VACUUM FULL writes to an entirely new file and then switches to it, as opposed to rewriting the current file in-place. I assume the reason for this is safety in the

Re: libpq host/hostaddr/conninfo inconsistencies

2019-02-21 Thread Fabien COELHO
Hello Tom, My only complaint about this is that it makes it sound like you *must* provide "host", even when giving "hostaddr": That is the idea, "hostaddr" is moslty never needed. It is the initial misleading issue I've been complaining about: one can specify an IP *both* in host

RE: Timeout parameters

2019-02-21 Thread MikalaiKeida
Hello, all. > tcp_socket_timeout (integer) > > Terminate and restart any session that has been idle for more than > the specified number of milliseconds to prevent client from infinite > waiting for server due to dead connection. This can be used both as > a brute force global query timeout and

Re: Row Level Security − leakproof-ness and performance implications

2019-02-21 Thread Pierre Ducroquet
On Wednesday, February 20, 2019 5:24:17 PM CET Tom Lane wrote: > Pierre Ducroquet writes: > > For simple functions like enum_eq/enum_ne, marking them leakproof is an > > obvious fix (patch attached to this email, including also textin/textout). > > This is not nearly as "obvious" as you think.

Re: WIP: Avoid creation of the free space map for small tables

2019-02-21 Thread Amit Kapila
On Thu, Feb 21, 2019 at 6:39 PM Alvaro Herrera wrote: > > On 2019-Feb-21, Amit Kapila wrote: > > > On Wed, Feb 20, 2019 at 8:08 PM Alvaro Herrera > > wrote: > > > > > > Please remember to keep serial_schedule in sync. > > > > I don't understand what you mean by this? It is already present in >

Re: libpq host/hostaddr/conninfo inconsistencies

2019-02-21 Thread Fabien COELHO
Hello Robert, (2) you are not against improving the documentation, although you find it clear enough already, but you agree that some people could get confused. The attached patch v4 only improves the documentation so that it reflects what the implementation really does. I think it too bad

Re: shared-memory based stats collector

2019-02-21 Thread Arthur Zakirov
Hello, On 21.02.2019 10:05, Kyotaro HORIGUCHI wrote: Done. This verison 16 looks as if the moving and splitting were not happen. Major changes are: - Restored old pgstats_* names. This largily shrinks the patch size to less than a half lines of v15. More than that, it gets easier to

Re: WAL insert delay settings

2019-02-21 Thread Stephen Frost
Greetings, * Ants Aasma (ants.aa...@eesti.ee) wrote: > On Thu, Feb 21, 2019 at 12:50 PM Stephen Frost wrote: > > > > Rate limit in front of WAL insertion would allow for allocating the > > > throughput between foreground and background tasks, and even allow for > > > priority inheritance to

Re: [PROPOSAL] Shared Ispell dictionaries

2019-02-21 Thread Arthur Zakirov
On 21.02.2019 15:45, Robert Haas wrote: On Wed, Feb 20, 2019 at 9:33 AM Arthur Zakirov wrote: I'm working on the (b) approach. I thought about a priority queue structure. There no such ready structure within PostgreSQL sources except binaryheap.c, but it isn't for concurrent algorithms. I

Re: WIP: Avoid creation of the free space map for small tables

2019-02-21 Thread Alvaro Herrera
On 2019-Feb-21, Amit Kapila wrote: > On Wed, Feb 20, 2019 at 8:08 PM Alvaro Herrera > wrote: > > > > Please remember to keep serial_schedule in sync. > > I don't understand what you mean by this? It is already present in > serial_schedule. In parallel_schedule, we are just moving this test >

Re: WAL insert delay settings

2019-02-21 Thread Ants Aasma
On Thu, Feb 21, 2019 at 12:50 PM Stephen Frost wrote: > > Rate limit in front of WAL insertion would allow for allocating the > > throughput between foreground and background tasks, and even allow for > > priority inheritance to alleviate priority inversion due to locks. > > I'm not sure how

Re: Unnecessary checks for new rows by some RI trigger functions?

2019-02-21 Thread Robert Haas
On Wed, Feb 20, 2019 at 9:27 AM Antonin Houska wrote: > However I find it confusing that the trigger functions pass detectNewRows=true > even if they only execute SELECT statement. I don't quite see what those two things have to do with each other, but I might be missing something. I stuck in a

Re: [PROPOSAL] Shared Ispell dictionaries

2019-02-21 Thread Robert Haas
On Wed, Feb 20, 2019 at 9:33 AM Arthur Zakirov wrote: > I'm working on the (b) approach. I thought about a priority queue > structure. There no such ready structure within PostgreSQL sources > except binaryheap.c, but it isn't for concurrent algorithms. I don't see why you need a priority queue

Re: Pluggable Storage - Andres's take

2019-02-21 Thread Robert Haas
On Thu, Feb 21, 2019 at 6:44 AM Amit Khandekar wrote: > Ok, so something like XidHorizonPrefetchState ? On similar lines, does > prefetch_buffer() function name sound too generic as well ? Yeah, that sounds good. And, yeah, then maybe rename the function too. > > +/* > > + * An arbitrary way

Re: Pluggable Storage - Andres's take

2019-02-21 Thread Amit Khandekar
On Thu, 21 Feb 2019 at 04:17, Robert Haas wrote: > > On Fri, Feb 8, 2019 at 5:18 AM Amit Khandekar wrote: > > In the attached v1 patch, the prefetch_distance is calculated as > > effective_io_concurrency + 10. Also it has some cosmetic changes. > > I did a little brief review of this patch and

Re: [patch] Add schema total size to psql \dn+

2019-02-21 Thread Julien Rouhaud
On Thu, Feb 21, 2019 at 11:49 AM Gilles Darold wrote: > > > When we want to get total size of all relation in a schema we have to > > execute one of our favorite DBA query. It is quite simple but what > > about displaying schema size when using \dn+ in psql ? > > [...] > > The attached simple

Re: WAL insert delay settings

2019-02-21 Thread Stephen Frost
Greetings, * Ants Aasma (ants.aa...@eesti.ee) wrote: > On Thu, Feb 21, 2019 at 2:20 AM Stephen Frost wrote: > > The issue with hitting those bandwidth limits is that you end up with > > queues outside of your control and therefore are unable to prioritize > > the data going through them. I

Re: [patch] Add schema total size to psql \dn+

2019-02-21 Thread Gilles Darold
Le 20/02/2019 à 23:26, Gilles Darold a écrit : > Hi all, > > > When we want to get total size of all relation in a schema we have to > execute one of our favorite DBA query. It  is quite simple but what > about displaying schema size when using \dn+ in psql ? > > > gilles=# \dn+ >  

Re: Reporting script runtimes in pg_regress

2019-02-21 Thread Christoph Berg
Re: Tom Lane 2019-02-18 <28360.1550506...@sss.pgh.pa.us> > >>> We should also strive to align "FAILED" properly. > > >> Yeah, not strictly required, but someone might want to play around with > >> it a bit. > > > FWIW I don't think we localize pg_regress output currently, so that > > argument

Solaris 10 (sparc) and unixODBC problem

2019-02-21 Thread Nariman Ibadullaev
I installed latest PostgreSQL-ODBC , OS=Solaris 10, Arch = Sparc. I can not use PostgreSQL ODBC in unixODBC. -bash-3.2$ LD_DEBUG=libs ./isql -v PG debug: debug: Solaris Linkers: 5.10-1.1518 debug: 19267: 19267: platform capability (CA_SUNW_PLAT) - sun4v 19267: machine capability (CA_SUNW_MACH) -

Re: WAL insert delay settings

2019-02-21 Thread Ants Aasma
On Thu, Feb 21, 2019 at 2:20 AM Stephen Frost wrote: > * Andres Freund (and...@anarazel.de) wrote: > > On 2019-02-20 18:46:09 -0500, Stephen Frost wrote: > > > * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: > > > > On 2/20/19 10:43 PM, Stephen Frost wrote: > > > > > Just to share a few

Inappropriate scope of local variable

2019-02-21 Thread Antonin Houska
In AfterTriggerSaveEvent(), the "new_shared" variable is not used outside the "for" loop, so I think it should be defined only within the loop. The following patch makes reading the code a little bit more convenient for me. diff --git a/src/backend/commands/trigger.c

Re: SQL statement PREPARE does not work in ECPG

2019-02-21 Thread Michael Meskes
Takahashi-san, > It works well for my statement > > "EXEC SQL PREPARE test_prep (int) AS SELECT id from test_table where > id = $1;". > > However, since data type information is not used, it does not works > well > for prepare statements which need data type information such as > "EXEC SQL

[PATCH] Allow transaction to partition table using FDW

2019-02-21 Thread mitani
Hi, I would like to use transactions with partitioning table using FDW, but transactions can not be used with the following error. 'ERROR: could not serialize access due to concurrent update So, I tried to write a very simple patch. This patch works for my purpose, but I do not know if it

Re: insensitive collations

2019-02-21 Thread Peter Eisentraut
On 2019-02-21 03:17, Peter Geoghegan wrote: > I wonder if it would be better to break this into distinct commits? I thought about that. Especially the planner/executor changes could be done separately, sort of as a way to address the thread "ExecBuildGroupingEqual versus collations". But I'm

Journal based VACUUM FULL

2019-02-21 Thread Ryan David Sheasby
Hi Team. New to contributing so hopefully this is the right place. I've searched the forum and it seems this is the place for feature requests/suggestions. I was reading on VACUUM and VACUUM FULL and saw that the current implementation of VACUUM FULL writes to an entirely new file and then

RE: Timeout parameters

2019-02-21 Thread Jamison, Kirk
On Thursday, February 21, 2019 2:56 PM (GMT+9), Tsunakawa, Takayuki wrote: >> 1) tcp_user_timeout parameter >> I think this can be "committed" separately when it's finalized. > Do you mean you've reviewed and tested the patch by simulating a > communication failure in the way Nagaura-san

RE: libpq debug log

2019-02-21 Thread Iwata, Aya
Hi Kirk, > Currently, the patch fails to build according to CF app. > As you know, it has something to do with the misspelling of function. > GetTimezoneInformation --> GetTimeZoneInformation Thank you. I fixed it. Please see my v7 patch. Regards, Aya Iwata

Re: restrict pg_stat_ssl to superuser?

2019-02-21 Thread Michael Paquier
On Wed, Feb 20, 2019 at 11:51:08AM +0100, Peter Eisentraut wrote: > So here is a patch doing it the "normal" way of nulling out all the rows > the user shouldn't see. That looks fine to me. > I haven't found any documentation of these access restrictions in the > context of pg_stat_activity. Is

  1   2   >