Re: Autovacuum on partitioned table (autoanalyze)

2020-04-29 Thread Amit Langote
On Sat, Apr 25, 2020 at 11:13 PM Justin Pryzby wrote: > > On Wed, Mar 18, 2020 at 11:30:39AM -0500, Justin Pryzby wrote: > > In the past, I think there's was talk that maybe someone would invent a > > clever > > way to dynamically combine all the partitions' statistics, so analyzing the > > paren

Re: Fixes for two separate bugs in nbtree VACUUM's page deletion

2020-04-29 Thread Masahiko Sawada
On Wed, 29 Apr 2020 at 01:17, Peter Geoghegan wrote: > > On Tue, Apr 28, 2020 at 12:21 AM Masahiko Sawada > wrote: > > I agree with both patches. > > Thanks for the review. > > > For the first fix it seems better to push down the logic to the page > > deletion code as your 0001 patch does so. The

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Fabien COELHO
Hello, more random thoughts about syntax, semantics, and keeping it relational. While I'm not a huge fan of it, one of the other databases implementing this functionality does so using the syntax: WITH ITERATIVE R AS '(' R0 ITERATE Ri UNTIL N (ITERATIONS | UPDATES) ')' Qf Where N in ITERATI

Re: Setting min/max TLS protocol in clientside libpq

2020-04-29 Thread Michael Paquier
On Wed, Apr 29, 2020 at 10:33:26PM +0200, Peter Eisentraut wrote: > This looks good to me, except that > > xreflabel="ssl-min-protocol-version" > > etc. needs to be changed to use underscores. Indeed, thanks. I have fixed this part and applied the patch. -- Michael signature.asc Description:

Re: Remove unnecessary relabel stripping

2020-04-29 Thread Michael Paquier
On Thu, Apr 30, 2020 at 09:37:41AM +0800, Richard Guo wrote: > On Thu, Apr 30, 2020 at 8:11 AM Tomas Vondra > wrote:> >> FWIW it'd be better to send the patch to the original thread instead of >> starting a new one. > > Ah yes, you're right. Sorry for not doing so. FWIW, I don't find the move fr

Re: Raw device on PostgreSQL

2020-04-29 Thread Thomas Munro
On Thu, Apr 30, 2020 at 12:26 PM Tomas Vondra wrote: > Yeah, I think the question is what are the expected benefits of using > raw devices. It might be an interesting exercise / experiment, but my > understanding is that most of the benefits can be achieved by using file > systems but with direct

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Jonathan S. Katz
On 4/29/20 11:26 PM, Tom Lane wrote: > "Jonathan S. Katz" writes: >> Clearly I was caught doing a single browser test (Chrome). > > Well, I've not tested anything but Safari, either ... > >> Reverted back to the verbose way sans !important, attached, which >> appears to be the consensus. If you

Can we remove the other_rels_list parameter for make_rels_by_clause_joins

2020-04-29 Thread Andy Fan
Hi: For a given level for join_search_one_level, it is always try to join every relation in joinrel[level-1] to *initial_rels*. but the current code doesn't show this directly. join_search_one_level if (level == 2) /* consider remaining initial rels */

Re: Bug with subqueries in recursive CTEs?

2020-04-29 Thread Andrew Gierth
> "Laurenz" == Laurenz Albe writes: Laurenz> I played with a silly example and got a result that surprises Laurenz> me: Laurenz> WITH RECURSIVE fib AS ( Laurenz> SELECT n, "fibₙ" Laurenz> FROM (VALUES (1, 1::bigint), (2, 1)) AS f(n,"fibₙ") Laurenz> UNION ALL Lau

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Tom Lane
"Jonathan S. Katz" writes: > Clearly I was caught doing a single browser test (Chrome). Well, I've not tested anything but Safari, either ... > Reverted back to the verbose way sans !important, attached, which > appears to be the consensus. If you can ACK this, I'll commit. This one works for m

Bug with subqueries in recursive CTEs?

2020-04-29 Thread Laurenz Albe
I played with a silly example and got a result that surprises me: WITH RECURSIVE fib AS ( SELECT n, "fibₙ" FROM (VALUES (1, 1::bigint), (2, 1)) AS f(n,"fibₙ") UNION ALL SELECT max(n) + 1, sum("fibₙ")::bigint FROM (SELECT n, "fibₙ"

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-29 Thread Amit Kapila
On Wed, Apr 29, 2020 at 9:36 PM Juan José Santamaría Flecha wrote: > > On Wed, Apr 29, 2020 at 3:50 PM Amit Kapila wrote: >> >> On Wed, Apr 29, 2020 at 5:57 PM Amit Kapila wrote: >> > >> > 2. I think the code in IsoLocaleName is quite confusing and difficult >> > to understand in back branches a

Re: WAL usage calculation patch

2020-04-29 Thread Amit Kapila
On Tue, Apr 28, 2020 at 7:38 AM Amit Kapila wrote: > > On Mon, Apr 27, 2020 at 1:22 PM Julien Rouhaud wrote: > > > > > I agree with that definition. I can send a cleanup patch if there's > > no objection. > > > > Okay, feel free to send the patch. Thanks for taking the initiative > to write a p

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Jonathan S. Katz
On 4/29/20 10:38 PM, Tom Lane wrote: > "Jonathan S. Katz" writes: >> Please see latest attached. I've eliminated the !important, condensed >> the CSS, and the desultory (yes, my word of the week) testing did not >> find issues in devel or earlier versions. > >> Please let me know if this works fo

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Tom Lane
"Jonathan S. Katz" writes: > Please see latest attached. I've eliminated the !important, condensed > the CSS, and the desultory (yes, my word of the week) testing did not > find issues in devel or earlier versions. > Please let me know if this works for you. If it does, I'll push it up to > pgweb

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-29 Thread Kyotaro Horiguchi
At Wed, 29 Apr 2020 18:58:16 -0400, Alvaro Herrera wrote in > On 2020-Apr-28, Alvaro Herrera wrote: > > > On 2020-Apr-28, Kyotaro Horiguchi wrote: > > > > > > Anyway I think this patch should fix it also -- instead of adding a new > > > > flag, we just rely on the existing flags (since do_chec

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Jonathan S. Katz
On 4/29/20 9:22 PM, Jonathan S. Katz wrote: > On 4/29/20 8:15 PM, Tom Lane wrote: >> "Jonathan S. Katz" writes: >>> On 4/29/20 7:40 PM, Jonathan S. Katz wrote: I'll compromise on the temporary importants, but first I want to see what's causing the need for it. Do you have a suggestion on

Re: Remove unnecessary relabel stripping

2020-04-29 Thread Richard Guo
On Thu, Apr 30, 2020 at 8:11 AM Tomas Vondra wrote: > On Wed, Apr 29, 2020 at 03:51:40PM +0800, Richard Guo wrote: > >Hi hackers, > > > >Per discussion in [1], we don't need to strip relabel for the expr > >explicitly before calling pull_varnos() to retrieve all mentioned > >relids. pull_varnos()

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-29 Thread Alvaro Herrera
On 2020-Apr-30, Kyotaro Horiguchi wrote: > At Tue, 28 Apr 2020 20:47:10 -0400, Alvaro Herrera > wrote in > > /* > > * After the sanity checks in CreateDecodingContext, make sure > > the > > * restart_lsn is valid. Avoid "cannot get changes" wording in >

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-29 Thread Kyotaro Horiguchi
Thank you for polishing and committing this. At Tue, 28 Apr 2020 20:47:10 -0400, Alvaro Herrera wrote in > I pushed this one. Some closing remarks: > > On 2020-Apr-28, Alvaro Herrera wrote: > > > On 2020-Apr-28, Kyotaro Horiguchi wrote: > > > > Agreed to describe what is failed rather than

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Jonathan S. Katz
On 4/29/20 8:15 PM, Tom Lane wrote: > "Jonathan S. Katz" writes: >> On 4/29/20 7:40 PM, Jonathan S. Katz wrote: >>> I'll compromise on the temporary importants, but first I want to see >>> what's causing the need for it. Do you have a suggestion on a page to test? > > I haven't yet pushed anythin

Re: Raw device on PostgreSQL

2020-04-29 Thread Tom Lane
Tomas Vondra writes: > Yeah, I think the question is what are the expected benefits of using > raw devices. It might be an interesting exercise / experiment, but my > understanding is that most of the benefits can be achieved by using file > systems but with direct I/O and async I/O, which would a

Re: Raw device on PostgreSQL

2020-04-29 Thread Jonah H. Harris
On Tue, Apr 28, 2020 at 8:10 AM Andreas Karlsson wrote: > It would require quite a bit of work since 1) PostgreSQL stores its data > in multiple files and 2) PostgreSQL currently supports only synchronous > buffered IO. > > To get the performance benefits from using raw devices I think you would

Re: Raw device on PostgreSQL

2020-04-29 Thread Tomas Vondra
On Tue, Apr 28, 2020 at 02:10:51PM +0200, Andreas Karlsson wrote: On 4/28/20 10:43 AM, Benjamin Schaller wrote: for an university project I'm currently doing some research on PostgreSQL. I was wondering if hypothetically it would be possible to implement a raw device system to PostgreSQL. I kno

Re: Can the OUT parameter be enabled in stored procedure?

2020-04-29 Thread David G. Johnston
On Wed, Apr 29, 2020 at 4:43 PM David Zhang wrote: > Hi hackers, > > I found two email threads below, > > > https://www.postgresql.org/message-id/b0d099ca-f9c3-00ed-0c95-4d7a9f7c97fc%402ndquadrant.com > > > https://www.postgresql.org/message-id/CA%2B4BxBwBHmDkSpgvnfG_Ps1SEeYhDRuLpr1AvdbUwFh-otTg8

Re: Remove unnecessary relabel stripping

2020-04-29 Thread Tomas Vondra
On Wed, Apr 29, 2020 at 03:51:40PM +0800, Richard Guo wrote: Hi hackers, Per discussion in [1], we don't need to strip relabel for the expr explicitly before calling pull_varnos() to retrieve all mentioned relids. pull_varnos() would recurse into T_RelabelType nodes. Add a patch to remove that

Re: xid wraparound danger due to INDEX_CLEANUP false

2020-04-29 Thread Peter Geoghegan
On Wed, Apr 29, 2020 at 2:56 PM Andres Freund wrote: > I'm not sure I see the advantage. Only doing so in the freezing case > seems unlikely to cause additional conflicts, but I'm less sure about > doing it always. btpo.xact will often be quite recent, right? So it'd > likely cause more conflicts.

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Jonathan S. Katz
On 4/29/20 7:40 PM, Jonathan S. Katz wrote: > On 4/29/20 7:29 PM, Tom Lane wrote: >> After further fooling with this issue, I've determined that >> >> (1) I need to be able to use environments within the >> func_table_entry cells and have them render more-or-less normally. >> There doesn't seem to

Can the OUT parameter be enabled in stored procedure?

2020-04-29 Thread David Zhang
Hi hackers, I found two email threads below, https://www.postgresql.org/message-id/b0d099ca-f9c3-00ed-0c95-4d7a9f7c97fc%402ndquadrant.com https://www.postgresql.org/message-id/CA%2B4BxBwBHmDkSpgvnfG_Ps1SEeYhDRuLpr1AvdbUwFh-otTg8A%40mail.gmail.com and I understood "OUT parameters in procedures

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Jonathan S. Katz
On 4/29/20 7:29 PM, Tom Lane wrote: > After further fooling with this issue, I've determined that > > (1) I need to be able to use environments within the > func_table_entry cells and have them render more-or-less normally. > There doesn't seem to be any other good way to render multiline > examp

Re: Poll: are people okay with function/operator table redesign?

2020-04-29 Thread Tom Lane
After further fooling with this issue, I've determined that (1) I need to be able to use environments within the func_table_entry cells and have them render more-or-less normally. There doesn't seem to be any other good way to render multiline example results for set-returning functions ... but m

Re: Improve errors when setting incorrect bounds for SSL protocols

2020-04-29 Thread Michael Paquier
On Wed, Apr 29, 2020 at 01:57:49PM +0200, Daniel Gustafsson wrote: > Working in the TLS corners of the backend, I found while re-reviewing and > re-testing for the release that this patch actually was a small, but vital, > brick shy of a load. The error handling is always invoked due to a set of >

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-29 Thread Alvaro Herrera
On 2020-Apr-28, Alvaro Herrera wrote: > On 2020-Apr-28, Kyotaro Horiguchi wrote: > > > > Anyway I think this patch should fix it also -- instead of adding a new > > > flag, we just rely on the existing flags (since do_checkpoint must have > > > been set correctly from the flags earlier in that bl

Re: Fixes for two separate bugs in nbtree VACUUM's page deletion

2020-04-29 Thread Peter Geoghegan
On Tue, Apr 28, 2020 at 12:21 AM Masahiko Sawada wrote: > For the first fix it seems better to push down the logic to the page > deletion code as your 0001 patch does so. The following change changes > the page deletion code so that it emits LOG message indicating the > index corruption when a del

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Jonah H. Harris
On Wed, Apr 29, 2020 at 5:54 PM Jonah H. Harris wrote: > On Wed, Apr 29, 2020 at 4:50 PM Corey Huinker > wrote: > >> Having both WHERE and WHILE might look awkward. >>> >> >> Maybe an UNTIL instead of WHILE? >> > > While I'm not a huge fan of it, one of the other databases implementing > this fu

Re: xid wraparound danger due to INDEX_CLEANUP false

2020-04-29 Thread Andres Freund
Hi, On 2020-04-29 13:40:55 -0700, Peter Geoghegan wrote: > On Wed, Apr 29, 2020 at 12:54 PM Andres Freund wrote: > > > Fundamentally, btvacuumpage() doesn't freeze 32-bit XIDs (from > > > bpto.xact) when it recycles deleted pages. It simply puts them in the > > > FSM without changing anything abo

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Jonah H. Harris
On Wed, Apr 29, 2020 at 4:50 PM Corey Huinker wrote: > Having both WHERE and WHILE might look awkward. >> > > Maybe an UNTIL instead of WHILE? > While I'm not a huge fan of it, one of the other databases implementing this functionality does so using the syntax: WITH ITERATIVE R AS '(' R0 ITERAT

Re: xid wraparound danger due to INDEX_CLEANUP false

2020-04-29 Thread Peter Geoghegan
On Wed, Apr 29, 2020 at 2:04 PM Peter Geoghegan wrote: > As a bonus, we now have an easy correctness cross-check: if some > random piece of nbtree code lands on a page (having followed a > downlink or sibling link) that is marked recycled, then clearly > something is very wrong -- throw a "can't h

Re: xid wraparound danger due to INDEX_CLEANUP false

2020-04-29 Thread Peter Geoghegan
On Wed, Apr 29, 2020 at 1:40 PM Peter Geoghegan wrote: > I'm not sure how low the costs would be, but at least we'd only have > to do it once per already-deleted page (i.e. only the first time a > VACUUM operation found _bt_page_eligible_for_recycling() returned true > for the page and marked it r

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Corey Huinker
> > > > Perhaps something like this would be more readable > > > > WITH t AS ( > >UPDATE ( SELECT 1 AS ctr, 'x' as val ) > >SET ctr = ctr + 1, val = val || 'x' > >WHILE ctr <= 100 > >RETURNING ctr, val > > ) > > > > The notion of an UPDATE on an ephemeral subquery isn't that special

Re: xid wraparound danger due to INDEX_CLEANUP false

2020-04-29 Thread Peter Geoghegan
On Wed, Apr 29, 2020 at 12:54 PM Andres Freund wrote: > > Fundamentally, btvacuumpage() doesn't freeze 32-bit XIDs (from > > bpto.xact) when it recycles deleted pages. It simply puts them in the > > FSM without changing anything about the page itself. This means > > surprisingly little in the cont

Re: Setting min/max TLS protocol in clientside libpq

2020-04-29 Thread Peter Eisentraut
On 2020-04-27 07:45, Michael Paquier wrote: On Sun, Apr 26, 2020 at 11:20:01PM +0200, Daniel Gustafsson wrote: That was the preferred name by Michael too elsewhere in the thread, so went ahead and made it so. Thanks Daniel. I would, however, prefer to also rename the internal symbols. Done

Re: Add A Glossary

2020-04-29 Thread Corey Huinker
On Wed, Apr 29, 2020 at 3:15 PM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > Why are all the glossary terms capitalized? Seems kind of strange. > > They weren't intended to be, and they don't appear to be in the page I'm looking at. Are you referring to the anchor like in https:/

Re: xid wraparound danger due to INDEX_CLEANUP false

2020-04-29 Thread Andres Freund
Hi, On 2020-04-29 11:28:00 -0700, Peter Geoghegan wrote: > On Thu, Apr 16, 2020 at 11:27 AM Andres Freund wrote: > > Sure, there is some pre-existing wraparound danger for individual > > pages. But it's a pretty narrow corner case before INDEX_CLEANUP > > off. > > > > That comment says something

Re: Cleanup/remove/update references to OID column

2020-04-29 Thread Justin Pryzby
Few comments seem to have dangling references to the behavior from pre-12 "WITH OIDS". Maybe varsup.c should get a wider change? diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index 1e743d7d86..ce84e22cbd 100644 --- a/src/backend/access/common/tupdesc.c ++

Re: Add A Glossary

2020-04-29 Thread Peter Eisentraut
Why are all the glossary terms capitalized? Seems kind of strange. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: new heapcheck contrib module

2020-04-29 Thread Mark Dilger
> On Apr 29, 2020, at 11:41 AM, Robert Haas wrote: > > On Wed, Apr 22, 2020 at 10:43 PM Mark Dilger > wrote: >> It's simple enough to extend the tap test a little to check for those >> things. In v3, the tap test skips tests if the page size is not 8k, and >> also if the tuples do not fall

Re: new heapcheck contrib module

2020-04-29 Thread Robert Haas
On Wed, Apr 29, 2020 at 12:30 PM Mark Dilger wrote: > Version 4 of this patch now includes boolean options skip_all_frozen and > skip_all_visible. I'm not sure sure, but maybe there should just be one argument with three possible values, because skip_all_frozen = true and skip_all_visible = fals

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Fabien COELHO
Hello Corey, Hello Peter, My 0.02 € about the alternative syntaxes: Peter: I think a syntax that would fit better within the existing framework would be something like WITH RECURSIVE t AS ( SELECT base case REPLACE ALL -- instead of UNION ALL SELECT recursive case ) A good po

Re: new heapcheck contrib module

2020-04-29 Thread Robert Haas
On Wed, Apr 22, 2020 at 10:43 PM Mark Dilger wrote: > It's simple enough to extend the tap test a little to check for those things. > In v3, the tap test skips tests if the page size is not 8k, and also if the > tuples do not fall on the page where expected (which would happen due to > alignme

Re: xid wraparound danger due to INDEX_CLEANUP false

2020-04-29 Thread Peter Geoghegan
On Thu, Apr 16, 2020 at 11:27 AM Andres Freund wrote: > Sure, there is some pre-existing wraparound danger for individual > pages. But it's a pretty narrow corner case before INDEX_CLEANUP > off. > > That comment says something about "shared-memory free space map", making > it sound like any crash

Re: SEQUENCE values (duplicated) in some corner cases when crash happens

2020-04-29 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Apr-29, Vinicius Abrahao wrote: >> I'm opening this thread to clarify something that I can observe: duplicated >> values for sequences. > I'm not sure that a sequence that produces the same value twice, without > writing it to the database the first time, and with

Re: new heapcheck contrib module

2020-04-29 Thread Robert Haas
On Wed, Apr 29, 2020 at 12:30 PM Mark Dilger wrote: > Do you think it would make sense to have the amcheck contrib module have, in > addition to the SQL queriable functions, a bgworker based mode that > periodically checks your database? The work along those lines is not > included in v4, but

Re: new heapcheck contrib module

2020-04-29 Thread Mark Dilger
>> I wonder if a mode where heapcheck optionally would only checks >> non-frozen (perhaps also non-all-visible) regions of a table would be a >> good idea? Version 4 of this patch now includes boolean options skip_all_frozen and skip_all_visible. >> Would make it a lot more viable to run this r

Re: SEQUENCE values (duplicated) in some corner cases when crash happens

2020-04-29 Thread Alvaro Herrera
On 2020-Apr-29, Vinicius Abrahao wrote: > Hello PG Hackers > > Hope you are well and safe! > > I'm opening this thread to clarify something that I can observe: duplicated > values for sequences. > > [My understanding is that duplication is not something we desire. In fact > it does NOT happen i

tablespace_map code cleanup

2020-04-29 Thread Robert Haas
Hi, I think it's not good that do_pg_start_backup() takes a flag which tells it to call back into basebackup.c's sendTablespace(). This means that details which ought to be private to basebackup.c leak out and become visible to other parts of the code. This seems to have originated in commit 72d42

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-29 Thread Juan José Santamaría Flecha
On Wed, Apr 29, 2020 at 3:50 PM Amit Kapila wrote: > On Wed, Apr 29, 2020 at 5:57 PM Amit Kapila > wrote: > > > > 2. I think the code in IsoLocaleName is quite confusing and difficult > > to understand in back branches and the changes due to this bug-fix > > made it more complicated. I am think

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Corey Huinker
On Wed, Apr 29, 2020 at 10:34 AM Jonah H. Harris wrote: > On Wed, Apr 29, 2020 at 7:22 AM Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: > >> Yeah the RECURSIVE vs ITERATIVE is a bit of a red herring here. As you >> say, the RECURSIVE keyword doesn't specify the processing but mar

SEQUENCE values (duplicated) in some corner cases when crash happens

2020-04-29 Thread Vinicius Abrahao
Hello PG Hackers Hope you are well and safe! I'm opening this thread to clarify something that I can observe: duplicated values for sequences. [My understanding is that duplication is not something we desire. In fact it does NOT happen in the majority of cases, for example, when you immediately

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2020-04-29 Thread Tomas Vondra
On Wed, Apr 29, 2020 at 11:34:24AM -0400, James Coleman wrote: On Wed, Apr 29, 2020 at 11:17 AM Tomas Vondra wrote: On Wed, Apr 29, 2020 at 10:26:12AM -0400, James Coleman wrote: >On Tue, Apr 28, 2020 at 7:05 PM Andres Freund wrote: >> >> Hi, >> >> On 2020-04-28 18:22:20 -0400, James Coleman

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2020-04-29 Thread James Coleman
On Wed, Apr 29, 2020 at 11:17 AM Tomas Vondra wrote: > > On Wed, Apr 29, 2020 at 10:26:12AM -0400, James Coleman wrote: > >On Tue, Apr 28, 2020 at 7:05 PM Andres Freund wrote: > >> > >> Hi, > >> > >> On 2020-04-28 18:22:20 -0400, James Coleman wrote: > >> > I cc'd Andres given his commit introduc

Re: Accidental use of the PVC_RECURSE_WINDOWFUNCS flag?

2020-04-29 Thread Antonin Houska
Antonin Houska wrote: > Second, if a window function appeared in the result of > make_partial_grouping_target() for any reason, the Agg node would fail to > evaluate it. Am I wrong? Well, this is PVC_RECURSE..., not PVC_INCLUDE..., so the window function cannot appear in the result. But I still

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2020-04-29 Thread Tomas Vondra
On Wed, Apr 29, 2020 at 10:26:12AM -0400, James Coleman wrote: On Tue, Apr 28, 2020 at 7:05 PM Andres Freund wrote: Hi, On 2020-04-28 18:22:20 -0400, James Coleman wrote: > I cc'd Andres given his commit introduced simplehash, so I figured > he'd probably have a few pointers on when each one

Accidental use of the PVC_RECURSE_WINDOWFUNCS flag?

2020-04-29 Thread Antonin Houska
I think that the PVC_RECURSE_WINDOWFUNCS flag shouldn't be used in make_partial_grouping_target(). First, this function uses the grouping_target (see grouping_planner()) as the input, and that should only contain the input expressions of window functions as opposed to the window functions themselv

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Jonah H. Harris
On Wed, Apr 29, 2020 at 7:22 AM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > Yeah the RECURSIVE vs ITERATIVE is a bit of a red herring here. As you > say, the RECURSIVE keyword doesn't specify the processing but marks the > fact that the specification of the query is recursive. >

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2020-04-29 Thread James Coleman
On Tue, Apr 28, 2020 at 7:05 PM Andres Freund wrote: > > Hi, > > On 2020-04-28 18:22:20 -0400, James Coleman wrote: > > I cc'd Andres given his commit introduced simplehash, so I figured > > he'd probably have a few pointers on when each one might be useful. > > [...] > > Do you have any thoughts

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-29 Thread Amit Kapila
On Wed, Apr 29, 2020 at 5:57 PM Amit Kapila wrote: > > > 2. I think the code in IsoLocaleName is quite confusing and difficult > to understand in back branches and the changes due to this bug-fix > made it more complicated. I am thinking to refactor it such that the > code for (_MSC_VER >= 1700 &

Re: [PATCH] Keeps tracking the uniqueness with UniqueKey

2020-04-29 Thread Andy Fan
On Wed, Apr 29, 2020 at 8:34 AM Andy Fan wrote: > > > On Wed, Apr 29, 2020 at 8:29 AM David Rowley wrote: > >> On Thu, 16 Apr 2020 at 14:17, Andy Fan wrote: >> > V6 also includes: >> > 1. Fix the comment misleading you mentioned above. >> > 2. Fixed a concern case for `relation_has_uniquekeys

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-29 Thread Amit Kapila
On Mon, Apr 27, 2020 at 4:50 PM Amit Kapila wrote: > > I think we should backpatch this till 9.5 as I could see the changes > made by commit 0fb54de9 to support MSVC2015 are present in that branch > and the same is mentioned in the commit message. > Today, I was thinking about the pros and cons o

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-29 Thread Amit Kapila
On Tue, Apr 28, 2020 at 11:39 PM Juan José Santamaría Flecha wrote: > > > On Mon, Apr 27, 2020 at 1:20 PM Amit Kapila wrote: >> >> I think we should backpatch this till 9.5 as I could see the changes >> made by commit 0fb54de9 to support MSVC2015 are present in that branch >> and the same is ment

Re: Improve errors when setting incorrect bounds for SSL protocols

2020-04-29 Thread Daniel Gustafsson
Working in the TLS corners of the backend, I found while re-reviewing and re-testing for the release that this patch actually was a small, but vital, brick shy of a load. The error handling is always invoked due to a set of missing braces. Going into the check will cause the context to be freed a

Re: [Proposal] Global temporary tables

2020-04-29 Thread tushar
On 4/29/20 8:52 AM, 曾文旌 wrote: Fixed the error message to make the expression more accurate. In v33. Thanks wenjing Please refer this scenario  , where getting an error while performing cluster o/p 1) X terminal - postgres=# create global temp table f(n int); CREATE TABLE Y Terminal - p

Re: Proposing WITH ITERATIVE

2020-04-29 Thread Peter Eisentraut
On 2020-04-29 07:09, Fabien COELHO wrote: I'm wondering about how to use such a feature in the context of WITH query with several queries having different behaviors. Currently "WITH" introduces a named-query (like a view), "WITH RECURSIVE" introduces a mix of recursive and named queries, pg reall

Re: improving basebackup.c's file-reading code

2020-04-29 Thread Hamid Akhtar
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 The idea and the patch looks good to me. It makes sense to chan

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

2020-04-29 Thread Dilip Kumar
On Wed, Apr 29, 2020 at 2:56 PM Dilip Kumar wrote: > > On Tue, Apr 28, 2020 at 3:55 PM Dilip Kumar wrote: > > > > On Tue, Apr 28, 2020 at 3:11 PM Amit Kapila wrote: > > > > > > On Mon, Apr 27, 2020 at 4:05 PM Dilip Kumar wrote: > > > > > > > [latest patches] > > > > > > v16-0004-Gracefully-hand

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

2020-04-29 Thread Dilip Kumar
On Tue, Apr 28, 2020 at 3:55 PM Dilip Kumar wrote: > > On Tue, Apr 28, 2020 at 3:11 PM Amit Kapila wrote: > > > > On Mon, Apr 27, 2020 at 4:05 PM Dilip Kumar wrote: > > > > > [latest patches] > > > > v16-0004-Gracefully-handle-concurrent-aborts-of-uncommitt > > - Any actions leading to trans

Remove unnecessary relabel stripping

2020-04-29 Thread Richard Guo
Hi hackers, Per discussion in [1], we don't need to strip relabel for the expr explicitly before calling pull_varnos() to retrieve all mentioned relids. pull_varnos() would recurse into T_RelabelType nodes. Add a patch to remove that and simplify the code a bit. [1] https://www.postgresql.org/me

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

2020-04-29 Thread Dilip Kumar
On Wed, Apr 29, 2020 at 12:37 PM Mahendra Singh Thalor wrote: > > On Wed, 29 Apr 2020 at 11:15, Mahendra Singh Thalor > wrote: > > > > On Fri, 24 Apr 2020 at 11:55, Dilip Kumar wrote: > > > > > > On Thu, Apr 23, 2020 at 2:28 PM Erik Rijkers wrote: > > > > > > > > On 2020-04-23 05:24, Dilip Kum

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

2020-04-29 Thread Mahendra Singh Thalor
On Wed, 29 Apr 2020 at 11:15, Mahendra Singh Thalor wrote: > > On Fri, 24 Apr 2020 at 11:55, Dilip Kumar wrote: > > > > On Thu, Apr 23, 2020 at 2:28 PM Erik Rijkers wrote: > > > > > > On 2020-04-23 05:24, Dilip Kumar wrote: > > > > On Wed, Apr 22, 2020 at 9:31 PM Erik Rijkers wrote: > > > >> >