Re: Some problems of recovery conflict wait events

2020-03-05 Thread Masahiko Sawada
On Wed, 4 Mar 2020 at 15:21, Fujii Masao wrote: > > > > On 2020/03/04 14:31, Masahiko Sawada wrote: > > On Wed, 4 Mar 2020 at 13:48, Fujii Masao > > wrote: > >> > >> > >> > >> On 2020/03/04 13:27, Michael Paquier wrote: > >>> On Wed, Mar 04, 2020 at 01:13:19PM +0900, Masahiko Sawada wrote: > >>>

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

2020-03-05 Thread Dilip Kumar
On Thu, Mar 5, 2020 at 12:15 PM Amit Kapila wrote: > > On Wed, Mar 4, 2020 at 11:45 AM Mahendra Singh Thalor > wrote: > > > > On Mon, 24 Feb 2020 at 15:39, Amit Kapila wrote: > > > > > > On Thu, Feb 20, 2020 at 8:06 AM Andres Freund wrote: > > > > > > > > What I'm advocating is that extension l

Re: PG_COLOR not mentioned in docs of vacuumlo, oid2name and pgbench

2020-03-05 Thread Daniel Gustafsson
> On 5 Mar 2020, at 08:26, Michael Paquier wrote: > > On Wed, Mar 04, 2020 at 10:05:30PM +0900, Michael Paquier wrote: >> On Wed, Mar 04, 2020 at 11:31:27AM +0100, Fabien COELHO wrote: >>> For "pgbench", you could also add the standard sentence that it uses libpq >>> environment variables, as it

Re: Asynchronous Append on postgres_fdw nodes.

2020-03-05 Thread Kyotaro Horiguchi
Thank you for the comment. At Thu, 5 Mar 2020 16:17:24 +1300, Thomas Munro wrote in > On Fri, Feb 28, 2020 at 9:08 PM Kyotaro Horiguchi > wrote: > > - v2-0001-Allow-wait-event-set-to-be-regsitered-to-resoure.patch > > The async feature uses WaitEvent, and it needs to be released on > > err

Re: logical replication empty transactions

2020-03-05 Thread Amit Kapila
On Wed, Mar 4, 2020 at 4:04 PM Dilip Kumar wrote: > > On Wed, Mar 4, 2020 at 3:47 PM Amit Kapila wrote: > > > > On Wed, Mar 4, 2020 at 11:16 AM Dilip Kumar wrote: > > > > > > On Wed, Mar 4, 2020 at 10:50 AM Amit Kapila > > > wrote: > > > > > > > > On Wed, Mar 4, 2020 at 9:52 AM Dilip Kumar >

Re: Identifying user-created objects

2020-03-05 Thread Masahiko Sawada
On Thu, 5 Mar 2020 at 16:36, Kyotaro Horiguchi wrote: > > At Thu, 5 Mar 2020 15:21:49 +0900, Masahiko Sawada > wrote in > > > > I don't come up with another use cases but, anyway, I think we need to > > > > clarify the scope of the feature. > > > > > > Agreed. Also we would need to consider that

Re: PG_COLOR not mentioned in docs of vacuumlo, oid2name and pgbench

2020-03-05 Thread Juan José Santamaría Flecha
On Thu, Mar 5, 2020 at 9:40 AM Daniel Gustafsson wrote: > > On 5 Mar 2020, at 08:26, Michael Paquier wrote: > > > > So, combining the feedback from Fabien, Juan and Daniel I am finishing > > with the attached. Any thoughts? > > LGTM +1 Regards

Re: pg_stat_progress_basebackup - progress reporting for pg_basebackup, in the server side

2020-03-05 Thread Julien Rouhaud
On Thu, Mar 5, 2020 at 8:15 AM Peter Eisentraut wrote: > > On 2020-03-05 05:53, Fujii Masao wrote: > > Or, as another approach, it might be worth considering to make > > the server always estimate the total backup size whether --progress is > > specified or not, as Amit argued upthread. If the tim

Re: Change atoi to strtol in same place

2020-03-05 Thread Daniel Gustafsson
> On 5 Mar 2020, at 06:06, Joe Nelson wrote: > > Daniel Gustafsson wrote: > >>> On 11 Feb 2020, at 17:54, Alvaro Herrera wrote: >>> >>> This patch doesn't currently apply; it has conflicts with at least >>> 01368e5d9da7 and 7e735035f208; even in 7e735035f208^ it applies with >>> fuzz. Please

Re: Identifying user-created objects

2020-03-05 Thread Kyotaro Horiguchi
At Thu, 5 Mar 2020 18:06:26 +0900, Masahiko Sawada wrote in > On Thu, 5 Mar 2020 at 16:36, Kyotaro Horiguchi > wrote: > > > > At Thu, 5 Mar 2020 15:21:49 +0900, Masahiko Sawada > > wrote in > > > > > I don't come up with another use cases but, anyway, I think we need to > > > > > clarify the

Re: pg_stat_progress_basebackup - progress reporting for pg_basebackup, in the server side

2020-03-05 Thread Jehan-Guillaume de Rorthais
On Thu, 5 Mar 2020 10:32:45 +0100 Julien Rouhaud wrote: > On Thu, Mar 5, 2020 at 8:15 AM Peter Eisentraut > wrote: > > > > On 2020-03-05 05:53, Fujii Masao wrote: > > > Or, as another approach, it might be worth considering to make > > > the server always estimate the total backup size whether

Re: pg_stat_progress_basebackup - progress reporting for pg_basebackup, in the server side

2020-03-05 Thread Kyotaro Horiguchi
At Thu, 5 Mar 2020 10:32:45 +0100, Julien Rouhaud wrote in > On Thu, Mar 5, 2020 at 8:15 AM Peter Eisentraut > wrote: > > > > On 2020-03-05 05:53, Fujii Masao wrote: > > > Or, as another approach, it might be worth considering to make > > > the server always estimate the total backup size whethe

Re: backup manifests

2020-03-05 Thread tushar
Hi, There is one scenario  where  i somehow able to run pg_validatebackup successfully but when i tried to start the server , it is failing Steps to reproduce - --create 2 base backup directory [centos@tushar-ldap-docker bin]$ ./pg_basebackup -D db1 [centos@tushar-ldap-docker bin]$ ./pg_baseba

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-05 Thread Komяpa
Hi, Thanks Laurenz for taking action on this and writing a better patch than my initial. This will help avoid both Mandrill-like downtimes and get Index Only Scan just work on large telemetry databases like the one I was responsible for back when I was in Juno. On Thu, Mar 5, 2020 at 9:40 AM Davi

Re: Crash by targetted recovery

2020-03-05 Thread Fujii Masao
On 2020/03/05 12:08, Kyotaro Horiguchi wrote: At Mon, 2 Mar 2020 20:54:04 +0900, Fujii Masao wrote in And random access during StandbyMode ususally (always?) lets RecPtr go back. I'm not sure WaitForWALToBecomeAvailable works correctly if we don't have a file in pg_wal and the REDO point i

Re: Some problems of recovery conflict wait events

2020-03-05 Thread Fujii Masao
On 2020/03/05 16:58, Masahiko Sawada wrote: On Wed, 4 Mar 2020 at 15:21, Fujii Masao wrote: On 2020/03/04 14:31, Masahiko Sawada wrote: On Wed, 4 Mar 2020 at 13:48, Fujii Masao wrote: On 2020/03/04 13:27, Michael Paquier wrote: On Wed, Mar 04, 2020 at 01:13:19PM +0900, Masahiko Saw

Re: backup manifests

2020-03-05 Thread tushar
There is one small observation if we use slash (/) with option -i then not getting the desired result Steps to reproduce - == [centos@tushar-ldap-docker bin]$ ./pg_basebackup -D test [centos@tushar-ldap-docker bin]$ touch test/*pg_notify*/dummy_file --working [centos@tushar-ldap-d

Re: Restore replication settings when modifying a field type

2020-03-05 Thread Peter Eisentraut
On 2020-02-11 00:38, Quan Zongliang wrote: new patch attached. I didn't like so much how the updating of the replica identity was hacked into the middle of ATRewriteCatalogs(). I have an alternative proposal in the attached patch that queues up an ALTER TABLE ... REPLICA IDENTITY command in

Re: allow trigger to get updated columns

2020-03-05 Thread Daniel Gustafsson
> On 24 Feb 2020, at 10:58, Peter Eisentraut > wrote: > > This is a change to make the bitmap of updated columns available to a trigger > in TriggerData. This is the same idea as was recently done to generated > columns [0]: Generic triggers such as tsvector_update_trigger can use this > inf

Re: logical replication empty transactions

2020-03-05 Thread Euler Taveira
On Thu, 5 Mar 2020 at 05:45, Amit Kapila wrote: > Euler, can we try to update the patch based on the number of > transactions threshold and see how it works? > > I will do. -- Euler Taveira http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training &

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2020-03-05 Thread Ibrar Ahmed
On Sat, Jun 29, 2019 at 12:56 AM Amit Kapila wrote: > On Thu, Jun 27, 2019 at 11:02 AM Pavan Deolasee > wrote: > > > >>> On 2019-04-07 18:04:27 -0700, Andres Freund wrote: > >>> > Here's a *prototype* patch for this. It only implements what I > >>> > described for heap_multi_insert, not for pla

Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Daniel Gustafsson
While looking at the tg_updatedcols patch I happened to notice that we still support pre-7.3 constraint triggers by converting them on the fly. AFAICT this requires a pre-7.3 dump to hit. This was added in late 2007 in a2899ebdc28080eab0f4bb0b8a5f30aa7bb31a89 due to a report from the field, but I

Re: Allow auto_explain to log plans before queries are executed

2020-03-05 Thread Julien Rouhaud
On Thu, Feb 27, 2020 at 7:31 AM Julien Rouhaud wrote: > > On Thu, Feb 27, 2020 at 7:12 AM Pavel Stehule wrote: > > > > čt 27. 2. 2020 v 7:01 odesílatel Yugo NAGATA napsal: > >> I think "query debugger" feature you proposed is out of scope of > >> auto_explain module. I also think the feature to

Should we remove a fallback promotion? take 2

2020-03-05 Thread Fujii Masao
Hi, We discussed the $SUBJECT six years ago at the following thread. https://postgr.es/m/CAHGQGwGYkF+CvpOMdxaO=+anazc1oo9o4lqwo50mxpvfj+0...@mail.gmail.com Seems our consensus at that discussion was to leave a fallback promotion for a release or two for debugging purpose or as an emergency metho

Re: Option to dump foreign data in pg_dump

2020-03-05 Thread Luis Carril
Hi everyone, I am just responding on the latest mail on this thread. But the question is about functionality. The proposal is to add a single flag --include-foreign-data which controls whether or not data is dumped for all the foreign tables in a database. That may not serve the purpose. A fore

Re: proposal: schema variables

2020-03-05 Thread Asif Rehman
On Sat, Feb 29, 2020 at 2:10 PM Pavel Stehule wrote: > > > pá 28. 2. 2020 v 16:30 odesílatel Pavel Stehule > napsal: > >> >> >> čt 27. 2. 2020 v 15:37 odesílatel Pavel Stehule >> napsal: >> >>> >>> Hi >>> >>> 3) Any way to define CONSTANTs ? We already talked a bit about this subject

Re: [Proposal] Global temporary tables

2020-03-05 Thread tushar
On 3/3/20 2:10 PM, 曾文旌(义从) wrote: I fixed in global_temporary_table_v16-pg13.patch. Please refer this scenario - --Connect to psql - postgres=# alter system set max_active_global_temporary_table =1; ALTER SYSTEM --restart the server (./pg_ctl -D data restart) --create global temp table pos

Re: useless RangeIOData->typiofunc

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-04, Tom Lane wrote: > Hm, I'm not sure that really lessens the cognitive load any, but > if you do commit this please fix the dangling reference you left > in the nearby comment: > > { > TypeCacheEntry *typcache; /* range type's typcache entry */ > - Oid typiofunc;

Re: useless RangeIOData->typiofunc

2020-03-05 Thread Tom Lane
Alvaro Herrera writes: > Thanks -- ISTM it makes more sense to put the FmgrInfo before the > typioparam too: > typedef struct RangeIOData > { > TypeCacheEntry *typcache;/* range type's typcache entry */ > FmgrInfoproc;/* element type's I/O function */ > Oid

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-05 Thread Laurenz Albe
On Thu, 2020-03-05 at 19:40 +1300, David Rowley wrote: > I think we need to move forward with doing something to cope with > INSERT-only tables not being auto-vacuumed. > > I think the patch you have is something along the lines to what I'd > have imagined we should do. However, there are a few th

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-05, Daniel Gustafsson wrote: > While looking at the tg_updatedcols patch I happened to notice that we still > support pre-7.3 constraint triggers by converting them on the fly. AFAICT > this > requires a pre-7.3 dump to hit. > > This was added in late 2007 in a2899ebdc28080eab0f4bb0

Re: [Proposal] Global temporary tables

2020-03-05 Thread Robert Haas
On Thu, Mar 5, 2020 at 9:19 AM tushar wrote: > WARNING: relfilenode 13589/1663/19063 not exist in gtt shared hash when > forget > ERROR: out of shared memory > HINT: You might need to increase max_active_gtt. > > also , would be great if we can make this error message user friendly like >

Re: Should we remove a fallback promotion? take 2

2020-03-05 Thread Robert Haas
On Thu, Mar 5, 2020 at 8:48 AM Fujii Masao wrote: > We discussed the $SUBJECT six years ago at the following thread. > https://postgr.es/m/CAHGQGwGYkF+CvpOMdxaO=+anazc1oo9o4lqwo50mxpvfj+0...@mail.gmail.com > > Seems our consensus at that discussion was to leave a fallback > promotion for a release

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Mar-05, Daniel Gustafsson wrote: >> While looking at the tg_updatedcols patch I happened to notice that we still >> support pre-7.3 constraint triggers by converting them on the fly. AFAICT >> this >> requires a pre-7.3 dump to hit. > I know it's a late in the c

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread David Steele
On 3/5/20 9:42 AM, Tom Lane wrote: Alvaro Herrera writes: On 2020-Mar-05, Daniel Gustafsson wrote: While looking at the tg_updatedcols patch I happened to notice that we still support pre-7.3 constraint triggers by converting them on the fly. AFAICT this requires a pre-7.3 dump to hit. I k

Re: useless RangeIOData->typiofunc

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-05, Tom Lane wrote: > Alvaro Herrera writes: > > Thanks -- ISTM it makes more sense to put the FmgrInfo before the > > typioparam too: > > > typedef struct RangeIOData > > { > > TypeCacheEntry *typcache;/* range type's typcache entry */ > > FmgrInfoproc;/*

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Daniel Gustafsson
> On 5 Mar 2020, at 15:42, Tom Lane wrote: > > Alvaro Herrera writes: >>> On 2020-Mar-05, Daniel Gustafsson wrote: >>> While looking at the tg_updatedcols patch I happened to notice that we still >>> support pre-7.3 constraint triggers by converting them on the fly. AFAICT >>> this >>> require

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Tom Lane
Daniel Gustafsson writes: > On 5 Mar 2020, at 15:42, Tom Lane wrote: >> +1 --- I think this fits in well with my nearby proposal to remove >> OPAQUE, which is also only relevant for pre-7.3 dumps. Let's just >> nuke that stuff. > Sounds good. I was opting for 14 to not violate the no new patche

Re: pg_stat_progress_basebackup - progress reporting for pg_basebackup, in the server side

2020-03-05 Thread Magnus Hagander
On Wed, Mar 4, 2020 at 11:15 PM Peter Eisentraut wrote: > > On 2020-03-05 05:53, Fujii Masao wrote: > > Or, as another approach, it might be worth considering to make > > the server always estimate the total backup size whether --progress is > > specified or not, as Amit argued upthread. If the ti

Re: Resume vacuum and autovacuum from interruption and cancellation

2020-03-05 Thread Ibrar Ahmed
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: not tested Documentation:not tested Please fix the regression test cases. The new status of this patch i

Re: pg_ls_tmpdir to show directories and shared filesets

2020-03-05 Thread Justin Pryzby
On Tue, Mar 03, 2020 at 05:23:13PM -0300, Alvaro Herrera wrote: > On 2020-Mar-03, Justin Pryzby wrote: > > > But I don't think it makes sense to go through more implementation/review > > cycles without some agreement from a larger group regarding the > > desired/intended interface. Should there b

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-03-05 Thread Alexey Kondratov
On 05.03.2020 09:24, Michael Paquier wrote: On Wed, Mar 04, 2020 at 08:14:20PM +0300, Alexey Kondratov wrote: - I did not actually get why you don't check for a missing command when using wait_result_is_any_signal. In this case I'd think that it is better to exit immediately as follow-up calls

Re: reindex concurrently and two toast indexes

2020-03-05 Thread Julien Rouhaud
On Thu, Mar 05, 2020 at 12:53:54PM +0900, Michael Paquier wrote: > On Wed, Mar 04, 2020 at 09:21:45AM +0100, Julien Rouhaud wrote: > > Thanks for the patch! I started to look at it during the weekend, but > > I got interrupted and unfortunately didn't had time to look at it > > since. > > No probl

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Vik Fearing
On 05/03/2020 16:33, Tom Lane wrote: > Elsewhere in indexcmds.c, there's this: > > /* > * Hack to provide more-or-less-transparent updating of old RTREE > * indexes to GiST: if RTREE is requested and not found, use GIST. > */ > if (strcmp(accessMethodName

Atomics in localbuf.c

2020-03-05 Thread Antonin Houska
What's the reason to use pg_atomic...read_...() and pg_atomic...write_...() functions in localbuf.c? It looks like there was an intention not to use them https://www.postgresql.org/message-id/CAPpHfdtfr3Aj7xJonXaKR8iY2p8uXOQ%2Be4BMpMDAM_5R4OcaDA%40mail.gmail.com but the following discussion does

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-05 Thread Justin Pryzby
On Thu, Mar 05, 2020 at 03:27:31PM +0100, Laurenz Albe wrote: > On Thu, 2020-03-05 at 19:40 +1300, David Rowley wrote: > > 1. I'd go for 2 new GUCs and reloptions. > > autovacuum_vacuum_insert_scale_factor and these should work exactly > > I disagree about the scale_factor (and have not added it t

Re: Psql patch to show access methods info

2020-03-05 Thread vignesh C
On Wed, Mar 4, 2020 at 5:02 AM Alexander Korotkov wrote: > > Hi! > > Thank you for the review. Revised patch is attached. > Thanks for working on comments and providing a new patch. One small observation I noticed: postgres=# \*dAc* brin oid Index access method operator classes AM

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-03-05 Thread Tomas Vondra
On Wed, Mar 04, 2020 at 10:28:32AM +0530, Amit Kapila wrote: On Wed, Mar 4, 2020 at 3:16 AM Tomas Vondra wrote: Hi, I started looking at this patch series again, hoping to get it moving for PG13. It is good to keep moving this forward, but there are quite a few problems with the design whi

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-03-05 Thread Tomas Vondra
On Wed, Mar 04, 2020 at 09:13:49AM +0530, Dilip Kumar wrote: On Wed, Mar 4, 2020 at 3:16 AM Tomas Vondra wrote: Hi, I started looking at this patch series again, hoping to get it moving for PG13. Nice. There's been a tremendous amount of work done since I last worked on it, and a lot was

Re: proposal: schema variables

2020-03-05 Thread Pavel Stehule
t; v2 > > 2020-03-05 12:13:37.192317 > (1 row) > postgres=# let test.v2 = default; > LET > postgres=# select test.v2; > v2 > ---- > 2020-03-05 12:14:07.538615 > (1 row) > > This is expected and wanted - same behave has plpgsql variables. CREATE OR REPLACE FUNCTION public.foo() RETURNS void LANGUAGE plpgsql AS $function$ declare x timestamp default current_timestamp; begin raise notice '%', x; end; $function$ postgres=# select foo(); NOTICE: 2020-03-05 18:49:12.465054 ┌─┐ │ foo │ ╞═╡ │ │ └─┘ (1 row) postgres=# select foo(); NOTICE: 2020-03-05 18:49:13.255197 ┌─┐ │ foo │ ╞═╡ │ │ └─┘ (1 row) You can use CREATE VARIABLE cuser AS text DEFAULT session_user; Has not any sense to use a value from creating time And a analogy with CREATE TABLE CREATE TABLE fooo(a timestamp DEFAULT current_timestamp) -- there is not a create time timestamp I fixed buggy behave of IMMUTABLE variables Regards Pavel > > To continue my testing of the patch I made few fixes for the > above-mentioned > comments. The patch for those changes is attached if it could be of any > use. > > -- > Asif Rehman > Highgo Software (Canada/China/Pakistan) > URL : www.highgo.ca > > schema-variables-20200305.patch.gz Description: application/gzip

Re: Atomics in localbuf.c

2020-03-05 Thread Andres Freund
Hi On March 5, 2020 9:21:55 AM PST, Antonin Houska wrote: >What's the reason to use pg_atomic...read_...() and >pg_atomic...write_...() >functions in localbuf.c? > >It looks like there was an intention not to use them > >https://www.postgresql.org/message-id/CAPpHfdtfr3Aj7xJonXaKR8iY2p8uXOQ%2Be4B

Re: more ALTER .. DEPENDS ON EXTENSION fixes

2020-03-05 Thread Ibrar Ahmed
On Mon, Mar 2, 2020 at 12:45 PM Ahsan Hadi wrote: > > > On Sat, Feb 29, 2020 at 2:38 AM Alvaro Herrera > wrote: > >> On 2020-Feb-28, ahsan hadi wrote: >> >> >> > Tested the pg_dump patch for dumping "ALTER .. DEPENDS ON EXTENSION" in >> case of indexes, functions, triggers etc. The "ALTER .. DEP

Re: more ALTER .. DEPENDS ON EXTENSION fixes

2020-03-05 Thread Ibrar Ahmed
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested It works for me

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-05, Tom Lane wrote: > As long as we're thinking of zapping code that is long past its sell-by > date, I propose getting rid of this stanza in indexcmds.c, which > basically causes CREATE INDEX to ignore certain opclass specifications: I agree, this should be fine to remove. > Elsewhe

Re: more ALTER .. DEPENDS ON EXTENSION fixes

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-05, Ibrar Ahmed wrote: > Is this intentional that there is no error when removing a non-existing > dependency? Hmm, I think we can do nothing silently if nothing is called for. So, yes, that seems to be the way it should work. -- Álvaro Herrerahttps://www.2ndQuadrant

Re: Allowing ALTER TYPE to change storage strategy

2020-03-05 Thread Tomas Vondra
On Wed, Mar 04, 2020 at 06:56:42PM -0500, Tom Lane wrote: I wrote: 3. Drop the ability for ALTER TYPE to promote from PLAIN to not-PLAIN typstorage, and adjust the typcache so that it only remembers boolean toastability not the specific toasting strategy. Then the cache is still immutable so no

Re: more ALTER .. DEPENDS ON EXTENSION fixes

2020-03-05 Thread Ibrar Ahmed
On Thu, Mar 5, 2020 at 11:38 PM Alvaro Herrera wrote: > On 2020-Mar-05, Ibrar Ahmed wrote: > > > Is this intentional that there is no error when removing a non-existing > > dependency? > > Hmm, I think we can do nothing silently if nothing is called for. > So, yes, that seems to be the way it sho

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

2020-03-05 Thread Mahendra Singh Thalor
On Thu, 5 Mar 2020 at 13:54, Dilip Kumar wrote: > > On Thu, Mar 5, 2020 at 12:15 PM Amit Kapila wrote: > > > > On Wed, Mar 4, 2020 at 11:45 AM Mahendra Singh Thalor > > wrote: > > > > > > On Mon, 24 Feb 2020 at 15:39, Amit Kapila wrote: > > > > > > > > On Thu, Feb 20, 2020 at 8:06 AM Andres Fre

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

2020-03-05 Thread Mahendra Singh Thalor
On Wed, 4 Mar 2020 at 12:03, Dilip Kumar wrote: > > On Wed, Mar 4, 2020 at 11:45 AM Mahendra Singh Thalor > wrote: > > > > On Mon, 24 Feb 2020 at 15:39, Amit Kapila wrote: > > > > > > On Thu, Feb 20, 2020 at 8:06 AM Andres Freund wrote: > > > > > > > > Hi, > > > > > > > > On 2020-02-19 11:12:18

Re: Allowing ALTER TYPE to change storage strategy

2020-03-05 Thread Tom Lane
Tomas Vondra writes: > FWIW I'm not suggesting you go and implement #1 or #2 for me, that'd be > up to me I guess. But I disagree there's no use case for it, and #3 > makes this featuer useless for me. OK, then we need to do something else. Do you have ideas for other alternatives? If not, we p

Fwd: WAL usage calculation patch

2020-03-05 Thread Kirill Bychik
> I'm quite worried about the stability of those counters for regression tests. > Wouldn't a checkpoint happening during the test change them? Agree, stability of test could be an issue, even shifting of write format or compression method or adding compatible changes could break such test. Frankly

Re: ALTER tbl rewrite loses CLUSTER ON index

2020-03-05 Thread Ibrar Ahmed
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested I tested the patch on the master branch (a77315fdf2a197a925e670b

Re: Planning counters in pg_stat_statements (using pgss_store)

2020-03-05 Thread legrand legrand
Never mind ... Please consider PG13 shortest path ;o) My one is parse->queryId != UINT64CONST(0) in pgss_planner_hook(). It fixes IVM problem (verified), and keep CTAS equal to pgss without planning counters (verified too). Regards PAscal -- Sent from: https://www.postgresql-archive.org/

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Daniel Gustafsson
> On 5 Mar 2020, at 19:36, Alvaro Herrera wrote: > > On 2020-Mar-05, Tom Lane wrote: > >> As long as we're thinking of zapping code that is long past its sell-by >> date, I propose getting rid of this stanza in indexcmds.c, which >> basically causes CREATE INDEX to ignore certain opclass specifi

Re: Atomics in localbuf.c

2020-03-05 Thread Antonin Houska
Andres Freund wrote: > On March 5, 2020 9:21:55 AM PST, Antonin Houska wrote: > >What's the reason to use pg_atomic...read_...() and > >pg_atomic...write_...() > >functions in localbuf.c? > > > >It looks like there was an intention not to use them > > > >https://www.postgresql.org/message-id/CAP

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

2020-03-05 Thread Robert Haas
On Thu, Mar 5, 2020 at 2:18 PM Mahendra Singh Thalor wrote: > Here, attaching new patch set for review. I was kind of assuming that the way this would work is that it would set a flag or increment a counter or something when we acquire a relation extension lock, and then reverse the process when

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Mar-05, Tom Lane wrote: >> As long as we're thinking of zapping code that is long past its sell-by >> date, I propose getting rid of this stanza in indexcmds.c, which >> basically causes CREATE INDEX to ignore certain opclass specifications: > I agree, this should

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Tom Lane
Daniel Gustafsson writes: > Having code which is untested and not excercised by developers (or users, if > my > assumption holds), yet being reachable by SQL, runs the risk of introducing > subtle bugs. Is there a usecase for keeping it, or can/should it be removed > in > 14? That would still

kerberos regression test enhancement

2020-03-05 Thread David Zhang
Hi Hackers, I found one interesting behavior when "--with-gssapi" is enabled, given a very "common" configuration in gp_hba.conf like below,     host    postgres    david   192.168.0.114/32    trust the query message is always encrypted when using a very "common" way connect to PG ser

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Tom Lane
Daniel Gustafsson writes: > When poking around here I realized that defGetStringList was also left unused. > It was added with the logical decoding code but the single callsite has since > been removed. As it's published in a header we might not want to remove it, > but I figured I'd bring it up

Re: Atomics in localbuf.c

2020-03-05 Thread Andres Freund
Hi On March 5, 2020 12:42:06 PM PST, Antonin Houska wrote: >Andres Freund wrote: > >> On March 5, 2020 9:21:55 AM PST, Antonin Houska >wrote: >> >What's the reason to use pg_atomic...read_...() and >> >pg_atomic...write_...() >> >functions in localbuf.c? >> > >> >It looks like there was an inte

Proposal: PqSendBuffer removal

2020-03-05 Thread Aleksei Ivanov
Dear community, I am really curious what was the original intention of using the PqSendBuffer and is it possible to remove it now. Currently all messages are copied from StringInfo to this buffer and sent, which from my point of view is redundant operation. It is possible to directly send message

Re: Proposal: PqSendBuffer removal

2020-03-05 Thread Tom Lane
Aleksei Ivanov writes: > I am really curious what was the original intention of using the > PqSendBuffer and is it possible to remove it now. > Currently all messages are copied from StringInfo to this buffer and sent, > which from my point of view is redundant operation. That would mean doing a

Re: Allowing ALTER TYPE to change storage strategy

2020-03-05 Thread Tomas Vondra
On Thu, Mar 05, 2020 at 02:52:44PM -0500, Tom Lane wrote: Tomas Vondra writes: FWIW I'm not suggesting you go and implement #1 or #2 for me, that'd be up to me I guess. But I disagree there's no use case for it, and #3 makes this featuer useless for me. OK, then we need to do something else.

Re: Proposal: PqSendBuffer removal

2020-03-05 Thread Aleksei Ivanov
Thank you for your reply! Yes, you are right there will be a separate call to send the data, but is copying data each time more costly operation than just one syscall? Besides, if we already have a ready message packet to be sent why should we wait? Waiting for your reply, Best regards! On Th

Re: [HACKERS] make async slave to wait for lsn to be replayed

2020-03-05 Thread Kartyshov Ivan
On 2018-03-06 14:50, Simon Riggs wrote: On 6 March 2018 at 11:24, Dmitry Ivanov wrote: In PG11, I propose the following command, sticking mostly to Ants' syntax, and allowing to wait for multiple events before it returns. It doesn't hold snapshot and will not get cancelled by Hot Standby. WA

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-05 Thread David Rowley
On Fri, 6 Mar 2020 at 03:27, Laurenz Albe wrote: > > On Thu, 2020-03-05 at 19:40 +1300, David Rowley wrote: > > 1. I'd go for 2 new GUCs and reloptions. > > autovacuum_vacuum_insert_threshold (you're currently calling this > > autovacuum_vacuum_insert_limit. I don't see why the word "limit" is > >

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-03-05 Thread James Coleman
On Tue, Jan 21, 2020 at 9:37 AM James Coleman wrote: > That being said, the patch also needs some more work on improving > EXPLAIN ANALYZE output (perhaps min/max/mean or median of > memory usage number of groups in each sort mode), and I think it's far > more feasible that I can tackle that piec

Re: Allowing ALTER TYPE to change storage strategy

2020-03-05 Thread Tom Lane
I wrote: > If not, we probably should bite the bullet and go for #1, since > I have little doubt that we'll need that someday anyway. > The trick will be to keep down the cache invalidation overhead... Here's a version that does it like that. I'm less worried about the overhead than I was before,

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-03-05 Thread Tom Lane
James Coleman writes: > I'm looking at this now, and realized that at least for parallel plans the > current patch tracks the tuplesort instrumentation whether or not an > EXPLAIN ANALYZE is in process. > Is this fairly standard for executor nodes? Or is it expected to condition > some of this tr

Re: pgbench: option delaying queries till connections establishment?

2020-03-05 Thread Fabien COELHO
Hello Andres, Slight aside: Have you ever looked at moving pgbench to non-blocking connection establishment? It seems weird to use non-blocking everywhere but connection establishment. Nope. If there is some interest, why not. The reason for not doing it is that the typical use case is just

Re: Proposal: PqSendBuffer removal

2020-03-05 Thread Tom Lane
Aleksei Ivanov writes: > Yes, you are right there will be a separate call to send the data, but is > copying data each time more costly operation than just one syscall? What do you mean "just one syscall"? The entire point here is that it'd take more syscalls to send the same amount of data. It

Re: Allowing ALTER TYPE to change storage strategy

2020-03-05 Thread Tom Lane
Tomas Vondra writes: > Yeah, I agree #1 seems like the cleanest/best option. Are you worried > about the overhead due to the extra complexity, or overhead due to > cache getting invalidated for this particular reason? The overhead is basically a hash_seq_search traversal over the typcache each ti

Re: Retiring support for pre-7.3 FK constraint triggers

2020-03-05 Thread Daniel Gustafsson
> On 5 Mar 2020, at 21:52, Tom Lane wrote: > > Daniel Gustafsson writes: >> Having code which is untested and not excercised by developers (or users, if >> my >> assumption holds), yet being reachable by SQL, runs the risk of introducing >> subtle bugs. Is there a usecase for keeping it, or ca

Re: Proposal: PqSendBuffer removal

2020-03-05 Thread Aleksei Ivanov
*> What do you mean "just one syscall"? The entire point here is that it'd take more syscalls to send the same amount of data.* I mean that it messages are large enough more than 2K we will need 4 syscalls without copy it to the internal buffer, but currently we will copy 8K of messages and send

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-03-05 Thread James Coleman
On Thu, Mar 5, 2020 at 5:53 PM Tom Lane wrote: > James Coleman writes: > > I'm looking at this now, and realized that at least for parallel plans > the > > current patch tracks the tuplesort instrumentation whether or not an > > EXPLAIN ANALYZE is in process. > > > Is this fairly standard for ex

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-03-05 Thread Tom Lane
James Coleman writes: > That's what I figured, but as I mentioned I've having trouble figuring out > how the fact that an analyze is in flight is determined. I assume it's > something that lives of the EState or similar, but I'm not seeing anything > obvious. AFAIR, it's just whether or not the c

Re: our checks for read-only queries are not great

2020-03-05 Thread Bruce Momjian
On Mon, Jan 27, 2020 at 02:26:42PM -0500, Stephen Frost wrote: > Greetings, > > * Bruce Momjian (br...@momjian.us) wrote: > > On Mon, Jan 13, 2020 at 01:56:30PM -0500, Stephen Frost wrote: > > > > I think that having ALTER SYSTEM commands in pg_dumpall output > > > > would be a problem. It would

Re: Additional improvements to extended statistics

2020-03-05 Thread Tomas Vondra
Hi, Here is a rebased version of this patch series. I've polished the first two parts a bit - estimation of OR clauses and (Var op Var) clauses, and added a bunch of regression tests to exercise this code. It's not quite there yet, but I think it's feasible to get this committed for PG13. The la

[PATCH] Make pkg-config files cross-compile friendly

2020-03-05 Thread Sebastian Kemper
Currently the pc files use hard coded paths for "includedir" and "libdir." Example: Cflags: -I/usr/include Libs: -L/usr/lib -lpq This is not very fortunate when cross compiling inside a buildroot, where the includes and libs are inside a staging directory, because this introduces host paths

Re: Psql patch to show access methods info

2020-03-05 Thread Alexander Korotkov
On Thu, Mar 5, 2020 at 8:34 PM vignesh C wrote: > On Wed, Mar 4, 2020 at 5:02 AM Alexander Korotkov > wrote: > > > > Hi! > > > > Thank you for the review. Revised patch is attached. > > > > Thanks for working on comments and providing a new patch. > One small observation I noticed: > postgres=#

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-03-05 Thread Michael Paquier
On Thu, Mar 05, 2020 at 07:52:24PM +0300, Alexey Kondratov wrote: > OK, I was still having in mind pg_rewind as the only one user of this > routine. Now it is a part of the common and I could imagine a hypothetical > tool that is polling the archive and waiting for a specific WAL segment to > becom

Re: Do we need to handle orphaned prepared transactions in the server?

2020-03-05 Thread Bruce Momjian
On Mon, Mar 2, 2020 at 05:42:11PM +0500, Hamid Akhtar wrote: > Here is the v2 of the same patch after rebasing it and running it through > pgindent. There are no other code changes. The paragraph about max_age_prepared_xacts doesn't define what is the effect of treating a transaction as orphaned.

Re: Crash by targetted recovery

2020-03-05 Thread Kyotaro Horiguchi
At Thu, 5 Mar 2020 19:51:11 +0900, Fujii Masao wrote in > > > On 2020/03/05 12:08, Kyotaro Horiguchi wrote: > > I understand that the reconnection for REDO record is useless. Ok I > > take the !StandbyMode way. > > The attached is the test script that is changed to count the added > > test, an

Re: reindex concurrently and two toast indexes

2020-03-05 Thread Michael Paquier
On Thu, Mar 05, 2020 at 05:57:07PM +0100, Julien Rouhaud wrote: > I agree that the approach wasn't quite robust. I'll try to look at adding a > new command for isolationtester, but that's probably not something we want to > put in pg13? Yes, that's too late. > Note that while looking at it, I no

Re: Should we remove a fallback promotion? take 2

2020-03-05 Thread Michael Paquier
On Thu, Mar 05, 2020 at 09:40:54AM -0500, Robert Haas wrote: > Seems reasonable, but it would be better if people proposed these > kinds of changes closer to the beginning of the release cycle rather > than in the crush at the end. +1, to both points. -- Michael signature.asc Description: PGP si

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-06, Michael Paquier wrote: > I was also thinking to split the patch into two pieces: > - Introduction of common/archive.c and common/fe_archive.c (the former > is used by xlogarchive.c and the latter only by pg_rewind). The > latter is dead code without the second patch, but this woul

Re: BUG #16147: postgresql 12.1 (from homebrew) - pg_restore -h localhost --jobs=2 crashes

2020-03-05 Thread David Zhang
Hi, I can reproduce this pg_restore crash issue (pg_dump crash too when running with multiple jobs) on MacOS 10.14 Mojave and MacOS 10.15 Catalina using following steps. 1. build pg_resotre from 12.2 with "--with-gssapi" enabled, or use the release from https://www.postgresql.org/download/ma

Re: Psql patch to show access methods info

2020-03-05 Thread vignesh C
On Fri, Mar 6, 2020 at 6:28 AM Alexander Korotkov wrote: > > On Thu, Mar 5, 2020 at 8:34 PM vignesh C wrote: > > On Wed, Mar 4, 2020 at 5:02 AM Alexander Korotkov > > wrote: > > > > > > Hi! > > > > > > Thank you for the review. Revised patch is attached. > > > > > > > Thanks for working on com

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

2020-03-05 Thread Amit Kapila
On Thu, Mar 5, 2020 at 1:54 PM Dilip Kumar wrote: > > On Thu, Mar 5, 2020 at 12:15 PM Amit Kapila wrote: > > > > > > 5. I have also tried to think of another way to check if we already > > hold lock type LOCKTAG_RELATION_EXTEND, but couldn't come up with a > > cheaper way than this. Basically, I

  1   2   >