Re: [proposal] recovery_target "latest"

2019-11-12 Thread Kyotaro Horiguchi
At Fri, 8 Nov 2019 16:08:47 +0300, Grigory Smolkin wrote in > > On 11/8/19 7:00 AM, Grigory Smolkin wrote: > > > > On 11/7/19 4:36 PM, Grigory Smolkin wrote: > >> I gave it some thought and now think that prohibiting recovery_target > >> 'latest' and standby was a bad idea. > >> All recovery_ta

Re: FETCH FIRST clause WITH TIES option

2019-11-12 Thread Surafel Temesgen
On Mon, Nov 11, 2019 at 5:56 PM Alvaro Herrera wrote: > First, I noticed that there's a significant unanswered issue from Andrew > Gierth about this using a completely different mechanism, namely an > implicit window function. I see that Robert was concerned about the > performance of Andrew's p

Re: Coding in WalSndWaitForWal

2019-11-12 Thread Michael Paquier
On Tue, Nov 12, 2019 at 11:27:16AM -0800, Andres Freund wrote: > It seems to me it'd be better to just remove the "get a more recent > flush pointer" block - it doesn't seem to currently surve a meaningful > purpose. +1. That was actually my suggestion upthread :) -- Michael signature.asc Descr

Re: [PATCH] use separate PartitionedRelOptions structure to store partitioned table options

2019-11-12 Thread Michael Paquier
On Tue, Nov 12, 2019 at 01:50:03PM +0900, Michael Paquier wrote: > We have been through great length to have build_reloptions, so > wouldn't it be better to also have this code path do so? Sure you > need to pass NULL for the parsing table.. But there is a point to > reduce the code paths using d

Re: [PATCH] Do not use StdRdOptions in Access Methods

2019-11-12 Thread Michael Paquier
On Wed, Nov 13, 2019 at 02:29:49PM +0900, Amit Langote wrote: > On Wed, Nov 13, 2019 at 2:18 PM Michael Paquier wrote: >> There could be an argument for keeping >> GET_STRING_RELOPTION actually which is still useful to get a string >> value in an option set using the stored offset, and we have >>

Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?

2019-11-12 Thread Michael Paquier
On Tue, Nov 12, 2019 at 10:33:16AM -0800, Andres Freund wrote: > On 2019-11-12 16:25:06 +0100, Daniel Gustafsson wrote: >> On 11 Nov 2019, at 09:32, Michael Paquier wrote: >> >>> This part has resulted in 75c1921, and we could just change >>> DecodeMultiInsert() so as if there is no tuple data th

RE: Recovery performance of DROP DATABASE with many tablespaces

2019-11-12 Thread k.jami...@fujitsu.com
On Wed, Oct. 2, 2019 5:40 PM, Fujii Masao wrote: > On Tue, Jul 10, 2018 at 3:04 PM Michael Paquier wrote: > > > > On Thu, Jul 05, 2018 at 01:42:20AM +0900, Fujii Masao wrote: > > > TBH, I have no numbers measured by the test. > > > One question about your test is; how did you measure the *recovery

Re: pg_waldump and PREPARE

2019-11-12 Thread Andrey Lepikhov
12.11.2019 12:41, Fujii Masao пишет: Ok, I changed the patch that way. Attached is the latest version of the patch. Regards, I did not see any problems in this version of the patch. The information displayed by pg_waldump for the PREPARE record is sufficient for use. -- Andrey Lepikhov P

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-11-12 Thread Ashwin Agrawal
On Sun, Nov 10, 2019 at 8:21 PM Thomas Munro wrote: > I pushed the first two, Thank You! but on another read-through of the main patch > I didn't like the comments for CheckForSerializableConflictOut() or > the fact that it checks SerializationNeededForRead() again, after I > thought a bit abo

Re: dropdb --force

2019-11-12 Thread Pavel Stehule
st 13. 11. 2019 v 7:12 odesílatel Amit Kapila napsal: > On Tue, Nov 12, 2019 at 11:17 AM Amit Kapila > wrote: > > > > I am planning to commit this patch tomorrow unless I see more comments > > or interest from someone else to review this. > > > > Pushed. Pavel, feel free to submit dropdb utilit

Re: dropdb --force

2019-11-12 Thread Amit Kapila
On Tue, Nov 12, 2019 at 11:17 AM Amit Kapila wrote: > > I am planning to commit this patch tomorrow unless I see more comments > or interest from someone else to review this. > Pushed. Pavel, feel free to submit dropdb utility-related patch if you want. -- With Regards, Amit Kapila. Enterprise

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Amit Kapila
On Tue, Nov 12, 2019 at 3:14 PM Mahendra Singh wrote: > > On Mon, 11 Nov 2019 at 16:36, Amit Kapila wrote: > > > > On Mon, Nov 11, 2019 at 2:53 PM Mahendra Singh wrote: > > > > > > > > > For small indexes also, we gained some performance by parallel vacuum. > > > > > > > Thanks for doing all the

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Masahiko Sawada
On Wed, 13 Nov 2019 at 12:43, Dilip Kumar wrote: > > On Tue, Nov 12, 2019 at 5:31 PM Masahiko Sawada > wrote: > > > > On Tue, 12 Nov 2019 at 20:29, Dilip Kumar wrote: > > > > > > On Tue, Nov 12, 2019 at 4:04 PM Masahiko Sawada > > > wrote: > > > > > > > > On Mon, 11 Nov 2019 at 17:57, Dilip Kum

Re: Invisible PROMPT2

2019-11-12 Thread Pavel Stehule
st 13. 11. 2019 v 4:15 odesílatel Thomas Munro napsal: > Hello hackers, > > From the advanced bikeshedding department: I'd like my psql > transcripts to have the usual alignment, but be easier to copy and > paste later without having weird prompt stuff in the middle. How > about a prompt format

Re: pg_waldump and PREPARE

2019-11-12 Thread Michael Paquier
On Tue, Nov 12, 2019 at 06:41:12PM +0900, Fujii Masao wrote: > Ok, I changed the patch that way. > Attached is the latest version of the patch. Thanks for the new patch. Looks fine to me. -- Michael signature.asc Description: PGP signature

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Amit Kapila
On Wed, Nov 13, 2019 at 9:48 AM Amit Kapila wrote: > > Yeah, 0,2,3 and 4 sounds reasonable to me. Earlier, Dilip also got > confused with option 1. > Let me try to summarize the discussion on this point and see if others have any opinion on this matter. We need a way to allow IndexAm to specify

Re: [PATCH] Do not use StdRdOptions in Access Methods

2019-11-12 Thread Amit Langote
On Wed, Nov 13, 2019 at 2:18 PM Michael Paquier wrote: > On Wed, Nov 13, 2019 at 10:52:52AM +0900, Amit Langote wrote: > > Thanks for chiming in about that. I guess that means that we don't > > need those macros, except GET_STRING_RELOPTION_LEN() that's used in > > allocateReloptStruct(), which c

Re: SPI error with non-volatile functions

2019-11-12 Thread Tom Mercha
On 13/11/2019 06:13, Andres Freund wrote: > Hi, > > On 2019-11-13 05:09:31 +, Tom Mercha wrote: >> I've been using SPI to execute some queries and this time I've tried to >> issue CREATE TABLE commands through SPI. I've been getting the message >> "ERROR: CREATE TABLE AS is not allowed in a no

Re: [PATCH] Do not use StdRdOptions in Access Methods

2019-11-12 Thread Michael Paquier
On Wed, Nov 13, 2019 at 10:52:52AM +0900, Amit Langote wrote: > Thanks for chiming in about that. I guess that means that we don't > need those macros, except GET_STRING_RELOPTION_LEN() that's used in > allocateReloptStruct(), which can be moved to reloptions.c. Is that > correct? I have been lo

Re: SPI error with non-volatile functions

2019-11-12 Thread Andres Freund
Hi, On 2019-11-13 05:09:31 +, Tom Mercha wrote: > I've been using SPI to execute some queries and this time I've tried to > issue CREATE TABLE commands through SPI. I've been getting the message > "ERROR: CREATE TABLE AS is not allowed in a non-volatile function". Any chance you're specifyi

SPI error with non-volatile functions

2019-11-12 Thread Tom Mercha
Dear Hackers I've been using SPI to execute some queries and this time I've tried to issue CREATE TABLE commands through SPI. I've been getting the message "ERROR: CREATE TABLE AS is not allowed in a non-volatile function". I'm a bit confused because my functions are set as volatile when I got

Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.

2019-11-12 Thread Michael Paquier
On Tue, Nov 12, 2019 at 09:35:03AM +0900, Michael Paquier wrote: > Indeed, thanks for looking. I thought that the callback was called > after checking for max_prepared_transaction, but that's not the case. > So let's add at least a test case. Any objections? Okay, done. -- Michael signature.as

Re: cost based vacuum (parallel)

2019-11-12 Thread Masahiko Sawada
On Tue, 12 Nov 2019 at 20:22, Masahiko Sawada wrote: > > On Tue, 12 Nov 2019 at 19:08, Amit Kapila wrote: > > > > On Tue, Nov 12, 2019 at 3:03 PM Dilip Kumar wrote: > > > > > > On Tue, Nov 12, 2019 at 10:47 AM Dilip Kumar > > > wrote: > > > > > > > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Dilip Kumar
On Wed, Nov 13, 2019 at 9:12 AM Dilip Kumar wrote: > > On Tue, Nov 12, 2019 at 5:31 PM Masahiko Sawada > wrote: > > > > On Tue, 12 Nov 2019 at 20:29, Dilip Kumar wrote: > > > > > > On Tue, Nov 12, 2019 at 4:04 PM Masahiko Sawada > > > wrote: > > > > > > > > On Mon, 11 Nov 2019 at 17:57, Dilip K

RE: libpq debug log

2019-11-12 Thread iwata....@fujitsu.com
Hello, Thank you for your review. I update patch. Please find attached my patch. > > 2019-04-04 02:39:51.488 UTC > Query 59 "SELECT > pg_catalog.set_config('search_path', '', false)" > > The "59" there seems quite odd, though. Could you explain more detail about this? "59" is length of protoc

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Amit Kapila
On Wed, Nov 13, 2019 at 8:34 AM Masahiko Sawada wrote: > > On Wed, 13 Nov 2019 at 11:38, Amit Kapila wrote: > > > > > It might be that we need to do it the way > > I originally proposed the different values of amparallelvacuumoptions > > or maybe some variant of it where the default value can cle

RE: New SQL counter statistics view (pg_stat_sql)

2019-11-12 Thread Smith, Peter
From: Thomas Munro Sent: Monday, 4 November 2019 1:43 PM > No comment on the patch but I noticed that the documentation changes don't > build. Please make sure you can "make docs" successfully, having installed > the documentation tools[1]. Thanks for the feedback. An updated patch which fix

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Dilip Kumar
On Tue, Nov 12, 2019 at 5:31 PM Masahiko Sawada wrote: > > On Tue, 12 Nov 2019 at 20:29, Dilip Kumar wrote: > > > > On Tue, Nov 12, 2019 at 4:04 PM Masahiko Sawada > > wrote: > > > > > > On Mon, 11 Nov 2019 at 17:57, Dilip Kumar wrote: > > > > > > > > On Tue, Oct 29, 2019 at 12:37 PM Masahiko S

RE: Proposal: Add more compile-time asserts to expose inconsistencies.

2019-11-12 Thread Smith, Peter
From: Andres Freund Sent: Wednesday, 13 November 2019 6:01 AM >Peter Smith: > > Is there a reason to not just make StaticAssertExpr and StaticAssertStmt be > the same? I don't want to proliferate variants that users have to understand > if there's no compelling > need. Nor do I think do we r

Invisible PROMPT2

2019-11-12 Thread Thomas Munro
Hello hackers, >From the advanced bikeshedding department: I'd like my psql transcripts to have the usual alignment, but be easier to copy and paste later without having weird prompt stuff in the middle. How about a prompt format directive %w that means "whitespace of the same width as %/"? Then

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2019-11-12 Thread Bruce Momjian
On Mon, Nov 11, 2019 at 05:37:30PM +0900, Michael Paquier wrote: > On Wed, Sep 11, 2019 at 06:30:22PM +0200, Julien Rouhaud wrote: > > The thing is that pg_stat_statements assigns a 0 queryid in the > > post_parse_analyze_hook to recognize utility statements and avoid > > tracking instrumentation t

Re: libpq sslpassword parameter and callback function

2019-11-12 Thread Bruce Momjian
On Sun, Nov 10, 2019 at 05:47:24PM +0800, Craig Ringer wrote: > Yep, that was a trivial change I rolled into it. > > FWIW, this is related to two other patches: the patch to allow passwordless > fdw > connections with explicit superuser approval, and the patch to allow sslkey/ > sslpassword to be

Re: Does 'instead of delete' trigger support modification of OLD

2019-11-12 Thread Bruce Momjian
On Mon, Nov 11, 2019 at 07:00:22PM +0300, Liudmila Mantrova wrote: > > > 8 нояб. 2019 г., в 0:26, Bruce Momjian написал(а): > > > > First, notice "only", which was missing from the later sentence: > > > >For INSERT and UPDATE > >operations [only], the trigger may modify the > >NEW r

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Masahiko Sawada
On Wed, 13 Nov 2019 at 11:38, Amit Kapila wrote: > > On Wed, Nov 13, 2019 at 6:53 AM Masahiko Sawada > wrote: > > > > On Tue, 12 Nov 2019 at 22:33, Amit Kapila wrote: > > > > > > > > > Hmm, I think we should define these flags in the most simple way. > > > Your previous proposal sounds okay to m

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Dilip Kumar
On Tue, Nov 12, 2019 at 7:03 PM Amit Kapila wrote: > > On Tue, Nov 12, 2019 at 5:30 PM Masahiko Sawada > wrote: > > > > On Tue, 12 Nov 2019 at 20:11, Amit Kapila wrote: > > > > > > On Tue, Nov 12, 2019 at 3:39 PM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, 12 Nov 2019 at 18:26, Dilip K

Re: [proposal] recovery_target "latest"

2019-11-12 Thread Kyotaro Horiguchi
At Fri, 8 Nov 2019 16:08:47 +0300, Grigory Smolkin wrote in > While working on it, I stumbled upon something strange: > > why DisownLatch(&XLogCtl->recoveryWakeupLatch) is called before > ReadRecord(xlogreader, LastRec, PANIC, false) ? > Isn`t this latch may be accessed in WaitForWALToBecomeAva

Re: ssl passphrase callback

2019-11-12 Thread Bruce Momjian
On Sun, Nov 10, 2019 at 01:01:17PM -0600, Magnus Hagander wrote: > On Wed, Nov 6, 2019 at 7:24 PM Bruce Momjian wrote: >   We had this > discussion in relation to archive_command years ago, and decided on a > shell command as the best API. > > I don't recall that from back then, but th

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Amit Kapila
On Wed, Nov 13, 2019 at 6:53 AM Masahiko Sawada wrote: > > On Tue, 12 Nov 2019 at 22:33, Amit Kapila wrote: > > > > > > Hmm, I think we should define these flags in the most simple way. > > Your previous proposal sounds okay to me. > > Okay. As you mentioned before, my previous proposal won't wor

Re: 'Invalid lp' during heap_xlog_delete

2019-11-12 Thread Daniel Wood
It's been tedious to get it exactly right but I think I got it. FYI, I was delayed because today we had yet another customer hit this: 'redo max offset' error. The system crashed as a number of autovacuums and a checkpoint happened and then the REDO failure. Two tiny code changes: bufmgr.c:b

Re: Add SQL function to show total block numbers in the relation

2019-11-12 Thread btkimurayuzk
Size in block number is useless for those who doesn't understand the notion of block, or block size. Those who understands the notion should come up with the simple formula (except the annoying casts). Anyone can find the clue to the base values by searching the document in the Web with the keywor

Re: [PATCH] Do not use StdRdOptions in Access Methods

2019-11-12 Thread Amit Langote
Hi Alvaro, On Wed, Nov 13, 2019 at 6:55 AM Alvaro Herrera wrote: > On 2019-Nov-07, Amit Langote wrote: > > On Tue, Nov 5, 2019 at 9:22 AM Michael Paquier wrote: > > > Please note that I have not switched the old interface > > > to be static to reloptions.c as if you look closely at reloptions.h

Re: [PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Kyotaro Horiguchi
At Tue, 12 Nov 2019 14:03:53 +, Ranier Vilela wrote in > Hi, > The condition is : > 74. if (TupIsNull(slot)) is true > 85. if (TupIsNull(resultTupleSlot)) is true too. See the definition of TupIsNull. It checks the tupleslot at a valid pointer is EMPTY as well. And node->ps.ps_ResultTupl

Re: Why overhead of SPI is so large?

2019-11-12 Thread Kyotaro Horiguchi
At Tue, 12 Nov 2019 11:27:24 +0300, Konstantin Knizhnik wrote in > > > On 11.11.2019 20:22, Tom Lane wrote: > > > > None of those statements are true, in my experience. > > > > In general, this patch seems like it's learned nothing from our > > experiences with the late and unlamented exec_sim

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Masahiko Sawada
On Tue, 12 Nov 2019 at 22:33, Amit Kapila wrote: > > On Tue, Nov 12, 2019 at 5:30 PM Masahiko Sawada > wrote: > > > > On Tue, 12 Nov 2019 at 20:11, Amit Kapila wrote: > > > > > > On Tue, Nov 12, 2019 at 3:39 PM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, 12 Nov 2019 at 18:26, Dilip Kum

Re: PHJ file leak.

2019-11-12 Thread Kyotaro Horiguchi
At Wed, 13 Nov 2019 09:48:19 +1300, Thomas Munro wrote in > On Tue, Nov 12, 2019 at 5:03 PM Thomas Munro wrote: > > On Tue, Nov 12, 2019 at 4:23 PM Thomas Munro wrote: > > > On Tue, Nov 12, 2019 at 4:20 PM Kyotaro Horiguchi > > > wrote: > > > > The previous patch would be wrong. The root caus

Re: checking my understanding of TupleDesc

2019-11-12 Thread Andres Freund
Hi, On 2019-11-12 18:20:56 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2019-11-12 17:39:20 -0500, Tom Lane wrote: > >> There's a semi-exception, which is that the planner might decide that we > >> can skip a projection step for the output of a table scan node, in which > >> case dropped

Re: make pg_attribute_noreturn() work for msvc?

2019-11-12 Thread Andres Freund
Hi, On 2019-11-12 18:15:28 -0500, Tom Lane wrote: > Andres Freund writes: > > It's worthwhile to note - I forgot this - that noreturn actually has > > been standardized in C11 and C++11. For C11 the keyword is _Noreturn, > > with a convenience macro 'noreturn' defined in stdnoreturn.h. > > > For

Re: checking my understanding of TupleDesc

2019-11-12 Thread Tom Lane
Andres Freund writes: > On 2019-11-12 17:39:20 -0500, Tom Lane wrote: >> There's a semi-exception, which is that the planner might decide that we >> can skip a projection step for the output of a table scan node, in which >> case dropped columns would be included in its output. But that would onl

Re: make pg_attribute_noreturn() work for msvc?

2019-11-12 Thread Tom Lane
Andres Freund writes: > It's worthwhile to note - I forgot this - that noreturn actually has > been standardized in C11 and C++11. For C11 the keyword is _Noreturn, > with a convenience macro 'noreturn' defined in stdnoreturn.h. > For C++11, the syntax is (please don't get an aneurysm...): > [[ n

Re: checking my understanding of TupleDesc

2019-11-12 Thread Andres Freund
Hi, On 2019-11-12 17:39:20 -0500, Tom Lane wrote: > > and under what other > > circumstances one would only encounter 'cleaned up' TupleDescs with > > no dropped attributes, and contiguous numbers for the real ones? > > I don't believe we ever include dropped columns in a projectio

Re: make pg_attribute_noreturn() work for msvc?

2019-11-12 Thread Andres Freund
Hi, On 2019-11-12 17:22:05 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2019-11-12 15:58:07 -0500, Tom Lane wrote: > > I'm a bit confused as to why pg_upgrade.h doesn't use 'extern' for > > function declarations? Not that it's really related, except for the > > 'extern' otherwise hiding

Re: checking my understanding of TupleDesc

2019-11-12 Thread Tom Lane
Chapman Flack writes: > On 09/29/19 20:13, Chapman Flack wrote: >> From looking around the code, I've made these tentative observations >> about TupleDescs: >> >> 1. If the TupleDesc was obtained straight from the relcache for some >> relation, then all of its attributes should have nonzero attre

Re: make pg_attribute_noreturn() work for msvc?

2019-11-12 Thread Tom Lane
Andres Freund writes: > On 2019-11-12 15:58:07 -0500, Tom Lane wrote: >> I guess my big question about that is whether pgindent will make a >> hash of it. > If one writes 'pg_noreturn void', rather than 'void pg_noreturn', then > there's only one place where pgindent changes something in a somewh

Re: JIT performance bug/regression & JIT EXPLAIN

2019-11-12 Thread Andres Freund
Hi, On 2019-11-12 13:42:10 -0800, Maciek Sakrejda wrote: > On Mon, Oct 28, 2019 at 5:02 PM Andres Freund wrote: > > What I dislike about that is that it basically again is introducing > > "again"? Am I missing some history here? I'd love to read up on this > if there are mistakes to learn from.

2019-11-14 Press Release Draft

2019-11-12 Thread Jonathan S. Katz
Hi, Attached is a draft of the press release for the update release going out on 2010-11-14. Please provide feedback, particularly on the technical accuracy of the statements. Thanks! Jonathan 2019-05-09 Cumulative Update Release The PostgreSQL Global Develo

Re: make pg_attribute_noreturn() work for msvc?

2019-11-12 Thread Andres Freund
On 2019-11-12 15:58:07 -0500, Tom Lane wrote: > Andres Freund writes: > > So perhaps we ought to rename pg_attribute_noreturn() to pg_noreturn(), > > add a __declspec(noreturn) version, and move the existing uses to it. > > > I'm inclined to also drop the parentheses at the same time (i.e > > pg_

Re: [PATCH] Do not use StdRdOptions in Access Methods

2019-11-12 Thread Alvaro Herrera
On 2019-Nov-07, Amit Langote wrote: > On Tue, Nov 5, 2019 at 9:22 AM Michael Paquier wrote: > > Please note that I have not switched the old interface > > to be static to reloptions.c as if you look closely at reloptions.h we > > allow much more flexibility around HANDLE_INT_RELOPTION to fill a

Re: auxiliary processes in pg_stat_ssl

2019-11-12 Thread Alvaro Herrera
On 2019-Nov-04, Stephen Frost wrote: > Based on what we claim in our docs, it does look like 'client_port IS > NOT NULL' should work. I do think we might want to update the docs to > make it a bit more explicit, what we say now is: > > TCP port number that the client is using for communication w

Re: auxiliary processes in pg_stat_ssl

2019-11-12 Thread Alvaro Herrera
On 2019-Nov-04, Euler Taveira wrote: > Yep, it is pointless. BackendType that open connections to server are: > autovacuum worker, client backend, background worker, wal sender. I > also notice that pg_stat_gssapi is in the same boat as pg_stat_ssl and > we should constraint the rows to backend ty

Re: JIT performance bug/regression & JIT EXPLAIN

2019-11-12 Thread Maciek Sakrejda
On Mon, Oct 28, 2019 at 5:02 PM Andres Freund wrote: > What I dislike about that is that it basically again is introducing "again"? Am I missing some history here? I'd love to read up on this if there are mistakes to learn from. > something that requires either pattern matching on key names (i.e

Re: Missing dependency tracking for TableFunc nodes

2019-11-12 Thread Andres Freund
On 2019-11-12 15:32:14 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2019-11-12 10:19:30 -0500, Tom Lane wrote: > >> I could imagine annotations that say "this field contains a function OID" > >> or "this list contains collation OIDs" and then the find_expr_references > >> logic could be d

Re: Collation versioning

2019-11-12 Thread Thomas Munro
On Wed, Nov 13, 2019 at 3:27 AM Julien Rouhaud wrote: > On Sun, Nov 10, 2019 at 10:08 AM Thomas Munro wrote: > > That's because the 0003 patch only calls recordDependencyOnVersion() > > for simple attribute references. When > > recordDependencyOnSingleRelExpr() is called by index_create() to > >

Re: make pg_attribute_noreturn() work for msvc?

2019-11-12 Thread Tom Lane
Andres Freund writes: > So perhaps we ought to rename pg_attribute_noreturn() to pg_noreturn(), > add a __declspec(noreturn) version, and move the existing uses to it. > I'm inclined to also drop the parentheses at the same time (i.e > pg_noreturn rather than pg_noreturn()) - it seems easier to m

Re: PHJ file leak.

2019-11-12 Thread Thomas Munro
On Tue, Nov 12, 2019 at 5:03 PM Thomas Munro wrote: > On Tue, Nov 12, 2019 at 4:23 PM Thomas Munro wrote: > > On Tue, Nov 12, 2019 at 4:20 PM Kyotaro Horiguchi > > wrote: > > > The previous patch would be wrong. The root cause is a open batch so > > > the right thing to be done at scan end is >

Re: Missing dependency tracking for TableFunc nodes

2019-11-12 Thread Tom Lane
Andres Freund writes: > On 2019-11-12 10:19:30 -0500, Tom Lane wrote: >> I could imagine annotations that say "this field contains a function OID" >> or "this list contains collation OIDs" and then the find_expr_references >> logic could be derived from that. > I want to attach some annotations t

make pg_attribute_noreturn() work for msvc?

2019-11-12 Thread Andres Freund
Hi, At the bottom of https://www.postgresql.org/message-id/20191112192716.emrqs2afuefunw6v%40alap3.anarazel.de I mused about the somewhat odd coding pattern at the end of WalSndShutdown(): /* * Handle a client's connection abort in an orderly manner. */ static void WalSndShutdown(void) {

Re: Extension development

2019-11-12 Thread Ahsan Hadi
Hi Yonatan, You can follow this blog for creating your own extension in PostgreSQL.. https://www.highgo.ca/2019/10/01/a-guide-to-create-user-defined-extension-modules-to-postgres/ -- Ahsan On Tue, Nov 12, 2019 at 11:54 AM Yonatan Misgan wrote: > I am developed my own PostgreSQL extension for

Re: Missing dependency tracking for TableFunc nodes

2019-11-12 Thread Andres Freund
Hi, On 2019-11-12 10:19:30 -0500, Tom Lane wrote: > I think that the long-term answer, if Andres gets somewhere with his > project to autogenerate code like this, is that we'd rely on annotating > the struct declarations to tell us what to do. In the case at hand, > I could imagine annotations th

Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays

2019-11-12 Thread Andres Freund
Hi, On 2019-11-12 14:17:42 +0900, Michael Paquier wrote: > On Tue, Oct 22, 2019 at 04:13:03PM +0530, Amit Kapila wrote: > > Hmm, but then what is your suggestion for existing code that uses {0}. > > If we reject this patch and leave the current code as it is, there is > > always a risk of some peo

Re: Coding in WalSndWaitForWal

2019-11-12 Thread Andres Freund
Hi, On 2019-11-11 13:53:40 -0300, Alvaro Herrera wrote: > On 2019-Nov-11, Amit Kapila wrote: > > > On Mon, Nov 11, 2019 at 7:53 AM Michael Paquier wrote: > > > > So your suggestion would be to call GetFlushRecPtr() before the first > > > check on RecentFlushPtr and before entering the loop? > >

Re: [Patch] Optimize dropping of relation buffers using dlist

2019-11-12 Thread Tomas Vondra
On Tue, Nov 12, 2019 at 10:49:49AM +, k.jami...@fujitsu.com wrote: On Thurs, November 7, 2019 1:27 AM (GMT+9), Robert Haas wrote: On Tue, Nov 5, 2019 at 10:34 AM Tomas Vondra wrote: > 2) This adds another hashtable maintenance to BufferAlloc etc. but > you've only done tests / benchmark

Re: Proposal: Add more compile-time asserts to expose inconsistencies.

2019-11-12 Thread Andres Freund
Hi Peter, Peter, :) On 2019-10-28 00:30:11 +, Smith, Peter wrote: > From: Andres Freund Sent: Sunday, 27 October 2019 12:03 > PM > > My proposal for this really was just to use this as a fallback for when > > static assert isn't available. Which in turn I was just suggesting because > > T

Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?

2019-11-12 Thread Andres Freund
On 2019-11-12 16:25:06 +0100, Daniel Gustafsson wrote: > > On 11 Nov 2019, at 09:32, Michael Paquier wrote: > > > This part has resulted in 75c1921, and we could just change > > DecodeMultiInsert() so as if there is no tuple data then we'd just > > leave. However, I don't feel completely comfort

Re: SQL/JSON: JSON_TABLE

2019-11-12 Thread Pavel Stehule
Hi please, can you rebase 0001-SQL-JSON-functions-v40.patch. I have a problem with patching Pavel

Re: segmentation fault when cassert enabled

2019-11-12 Thread Jehan-Guillaume de Rorthais
On Mon, 28 Oct 2019 16:47:02 +0900 (JST) Kyotaro Horiguchi wrote: > At Fri, 25 Oct 2019 12:28:38 -0400, Tom Lane wrote in > > Jehan-Guillaume de Rorthais writes: > > > When investigating for the bug reported in thread "logical replication - > > > negative bitmapset member not allowed", I fou

Re: Built-in connection pooler

2019-11-12 Thread Konstantin Knizhnik
Hi On 12.11.2019 10:50, ideriha.take...@fujitsu.com wrote: Hi. From: Konstantin Knizhnik [mailto:k.knizh...@postgrespro.ru] New version of builtin connection pooler fixing handling messages of extended protocol. Here are things I've noticed. 1. Is adding guc to postgresql.conf.sample usefu

[PATCH][BUG FIX] Potential uninitialized vars used.

2019-11-12 Thread Ranier Vilela
Hi, Var TargetEntry *tle; Have several paths where can it fail. Can anyone check this bug fix? --- \dll\postgresql-12.0\a\backend\parser\parse_expr.c Mon Sep 30 17:06:55 2019 +++ parse_expr.cTue Nov 12 12:43:07 2019 @@ -349,6 +349,7 @@ errmsg("DEF

Re: Option to dump foreign data in pg_dump

2019-11-12 Thread Daniel Gustafsson
> On 12 Nov 2019, at 15:21, Luis Carril wrote: > >> The nitpicks have been addressed. However, it seems that the new file >> containing the test FDW seems missing from the new version of the patch. Did >> you forget to git add the file? > Yes, I forgot, thanks for noticing. New patch attached a

Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?

2019-11-12 Thread Daniel Gustafsson
> On 11 Nov 2019, at 09:32, Michael Paquier wrote: > This part has resulted in 75c1921, and we could just change > DecodeMultiInsert() so as if there is no tuple data then we'd just > leave. However, I don't feel completely comfortable with that either > as it would be nice to still check that f

Re: documentation inconsistent re: alignment

2019-11-12 Thread Tom Lane
Chapman Flack writes: > On 10/20/19 14:47, Tom Lane wrote: >> Probably the statement in CREATE TYPE is too strong. There are, I >> believe, still machines in the buildfarm where maxalign is just 4. > So just closing the circle on this, the low-down seems to be that > the alignments called s, i,

Re: Missing dependency tracking for TableFunc nodes

2019-11-12 Thread Tom Lane
Mark Dilger writes: > I played with this a bit, making the change I proposed, and got lots of > warnings from the compiler. I don't know how many of these would need > to be suppressed by adding a no-op for them at the end of the switch vs. > how many need to be handled, but the attached patch

Re: Option to dump foreign data in pg_dump

2019-11-12 Thread Alvaro Herrera
On 2019-Nov-12, Luis Carril wrote: > But, not all foreign tables are necessarily in a remote server like > the ones referenced by the postgres_fdw. > In FDWs like swarm64da, cstore, citus or timescaledb, the foreign > tables are part of your database, and one could expect that a dump of > the data

Re: Collation versioning

2019-11-12 Thread Julien Rouhaud
On Sun, Nov 10, 2019 at 10:08 AM Thomas Munro wrote: > > Some more thoughts: > > 1. If you create an index on an expression that includes a COLLATE or > a partial index that has one in the WHERE clause, you get bogus > warnings: > > postgres=# create table t (v text); > CREATE TABLE > postgres=#

Re: Option to dump foreign data in pg_dump

2019-11-12 Thread Luis Carril
The nitpicks have been addressed. However, it seems that the new file containing the test FDW seems missing from the new version of the patch. Did you forget to git add the file? Yes, I forgot, thanks for noticing. New patch attached again. Cheers Luis M Carril diff --git a/doc/src/sgml/ref

RE: [PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Ranier Vilela
Hi, The condition is : 74. if (TupIsNull(slot)) is true 85. if (TupIsNull(resultTupleSlot)) is true too. If resultTupleSlot is not can be NULL, why test if (TupIsNull(resultTupleSlot))? Occurring these two conditions ExecClearTuple is called, but, don't check by NULL arg. There are at least 2

Re: [PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Daniel Gustafsson
> On 12 Nov 2019, at 14:07, Ranier Vilela wrote: > ExecClearTuple don't check por NULL pointer arg and according > TupIsNull slot can be NULL. I assume you are referring to the TupIsNull(resultTupleSlot) check a few lines down in the same loop? If resultTupleSlot was indeed NULL and not empty,

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Amit Kapila
On Tue, Nov 12, 2019 at 5:30 PM Masahiko Sawada wrote: > > On Tue, 12 Nov 2019 at 20:11, Amit Kapila wrote: > > > > On Tue, Nov 12, 2019 at 3:39 PM Masahiko Sawada > > wrote: > > > > > > On Tue, 12 Nov 2019 at 18:26, Dilip Kumar wrote: > > > > > > > > On Tue, Nov 12, 2019 at 2:25 PM Amit Kapila

Re: Option to dump foreign data in pg_dump

2019-11-12 Thread Daniel Gustafsson
> On 12 Nov 2019, at 12:12, Luis Carril wrote: >a new version of the patch with the tests from Daniel (thanks!) and the > nitpicks. The nitpicks have been addressed. However, it seems that the new file containing the test FDW seems missing from the new version of the patch. Did you forget

Re: MarkBufferDirtyHint() and LSN update

2019-11-12 Thread Antonin Houska
Kyotaro Horiguchi wrote: > At Mon, 11 Nov 2019 10:03:14 +0100, Antonin Houska wrote > in > > Michael Paquier wrote: > > > Does something like the attached patch make sense? Reviews are > > > welcome. > > > > This looks good to me. > > I have a qustion. > > The current code assumes that !B

[PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Ranier Vilela
Hi, ExecClearTuple don't check por NULL pointer arg and according TupIsNull slot can be NULL. Can anyone check this buf fix? --- \dll\postgresql-12.0\a\backend\executor\nodeUnique.cMon Sep 30 17:06:55 2019 +++ nodeUnique.cTue Nov 12 09:54:34 2019 @@ -74,7 +74,8 @@

Re: MarkBufferDirtyHint() and LSN update

2019-11-12 Thread Kyotaro Horiguchi
At Mon, 11 Nov 2019 10:03:14 +0100, Antonin Houska wrote in > Michael Paquier wrote: > > Does something like the attached patch make sense? Reviews are > > welcome. > > This looks good to me. I have a qustion. The current code assumes that !BM_DIRTY means that the function is dirtying the pa

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Masahiko Sawada
On Tue, 12 Nov 2019 at 20:29, Dilip Kumar wrote: > > On Tue, Nov 12, 2019 at 4:04 PM Masahiko Sawada > wrote: > > > > On Mon, 11 Nov 2019 at 17:57, Dilip Kumar wrote: > > > > > > On Tue, Oct 29, 2019 at 12:37 PM Masahiko Sawada > > > wrote: > > > > I realized that v31-0006 patch doesn't work f

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Masahiko Sawada
On Tue, 12 Nov 2019 at 20:11, Amit Kapila wrote: > > On Tue, Nov 12, 2019 at 3:39 PM Masahiko Sawada > wrote: > > > > On Tue, 12 Nov 2019 at 18:26, Dilip Kumar wrote: > > > > > > On Tue, Nov 12, 2019 at 2:25 PM Amit Kapila > > > wrote: > > > > > > > > Yeah, maybe something like amparallelvacuu

RE: [BUG FIX] Uninitialized var fargtypes used.

2019-11-12 Thread Ranier Vilela
Hi, Sorry by error in the patch. --- \dll\postgresql-12.0\a\backend\commands\event_trigger.c Mon Sep 30 17:06:55 2019 +++ event_trigger.c Tue Nov 12 08:34:30 2019 @@ -171,7 +171,7 @@ HeapTuple tuple; Oid funcoid; Oid funcrettype; - Oid fargtypes[1]; /* dummy */ + Oid fargtypes[1] = {Invalid

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

2019-11-12 Thread Kuntal Ghosh
On Tue, Nov 12, 2019 at 4:12 PM Alexey Kondratov wrote: > > On 04.11.2019 13:05, Kuntal Ghosh wrote: > > On Mon, Nov 4, 2019 at 3:32 PM Dilip Kumar wrote: > >> So your result shows that with "streaming on", performance is > >> degrading? By any chance did you try to see where is the bottleneck?

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Dilip Kumar
On Tue, Nov 12, 2019 at 4:04 PM Masahiko Sawada wrote: > > On Mon, 11 Nov 2019 at 17:57, Dilip Kumar wrote: > > > > On Tue, Oct 29, 2019 at 12:37 PM Masahiko Sawada > > wrote: > > > I realized that v31-0006 patch doesn't work fine so I've attached the > > > updated version patch that also incor

Re: cost based vacuum (parallel)

2019-11-12 Thread Masahiko Sawada
On Tue, 12 Nov 2019 at 19:08, Amit Kapila wrote: > > On Tue, Nov 12, 2019 at 3:03 PM Dilip Kumar wrote: > > > > On Tue, Nov 12, 2019 at 10:47 AM Dilip Kumar wrote: > > > > > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila > > > wrote: > > > > > > > > On Mon, Nov 11, 2019 at 12:59 PM Dilip Kumar

Re: Option to dump foreign data in pg_dump

2019-11-12 Thread Luis Carril
Hello a new version of the patch with the tests from Daniel (thanks!) and the nitpicks. I don't feel good about this feature. pg_dump should not dump any data that are not part of the database being dumped. If you restore such a dump, the data will be inserted into the foreign table, right?

Re: [HACKERS] Block level parallel vacuum

2019-11-12 Thread Amit Kapila
On Tue, Nov 12, 2019 at 3:39 PM Masahiko Sawada wrote: > > On Tue, 12 Nov 2019 at 18:26, Dilip Kumar wrote: > > > > On Tue, Nov 12, 2019 at 2:25 PM Amit Kapila wrote: > > > > > > Yeah, maybe something like amparallelvacuumoptions. The options can be: > > > > > > VACUUM_OPTION_NO_PARALLEL 0 #

Re: Attempt to consolidate reading of XLOG page

2019-11-12 Thread Antonin Houska
Michael Paquier wrote: > On Mon, Nov 11, 2019 at 04:25:56PM +0100, Antonin Houska wrote: > >> On Fri, Oct 04, 2019 at 12:11:11PM +0200, Antonin Houska wrote: > >> Your patch removes all the three optional lseek() calls which can > >> happen in a segment. Am I missing something but isn't that pla

  1   2   >