Re: Add default role 'pg_access_server_files'

2018-03-26 Thread Michael Paquier
On Sun, Mar 25, 2018 at 09:43:25PM -0400, Stephen Frost wrote: > * Michael Paquier (mich...@paquier.xyz) wrote: >> On Thu, Mar 08, 2018 at 10:15:11AM +0900, Michael Paquier wrote: >> > Other than that the patch looks in pretty good shape to me. >> >> The regression tests of file_fdw are blowing up

Re: PATCH: Configurable file mode mask

2018-03-26 Thread Michael Paquier
On Fri, Mar 23, 2018 at 12:26:47PM -0400, David Steele wrote: > I've attached a patch that integrates my tests with the current tests. > If you don't think they are worth adding then I'll just drop them from > my patchset. It seems to me that those tests have values (we can add more tests for tran

Re: PATCH: Exclude unlogged tables from base backups

2018-03-26 Thread Pavan Deolasee
On Fri, Mar 23, 2018 at 9:51 PM, David Steele wrote: > On 3/23/18 12:14 PM, Teodor Sigaev wrote: > > > > Thank you, pushed > > Is it just me or the newly added test in 010_pg_basebackup.pl failing for others too? # Failed test 'unlogged main fork not in backup' # at t/010_pg_basebackup.pl li

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Kyotaro HORIGUCHI
Hello. At Mon, 26 Mar 2018 17:49:22 +1100, Haribabu Kommi wrote in > On Mon, Mar 26, 2018 at 4:17 PM, Michael Paquier > wrote: > > > On Mon, Mar 26, 2018 at 11:28:41AM +0900, Kyotaro HORIGUCHI wrote: > > > At Sun, 25 Mar 2018 22:27:09 +1100, Haribabu Kommi < > > kommi.harib...@gmail.com> wrot

Re: Faster inserts with mostly-monotonically increasing values

2018-03-26 Thread Pavan Deolasee
On Sun, Mar 25, 2018 at 6:00 AM, Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > On Fri, Mar 23, 2018 at 8:27 PM, Pavan Deolasee > wrote: > >> > >> > >> I would probably just have a few regression lines that should be sure > >> to exercise the code path and leave it at that. > >> > > >

Re: PATCH: Exclude unlogged tables from base backups

2018-03-26 Thread Pavan Deolasee
On Mon, Mar 26, 2018 at 1:03 PM, Pavan Deolasee wrote: > On Fri, Mar 23, 2018 at 9:51 PM, David Steele wrote: > >> On 3/23/18 12:14 PM, Teodor Sigaev wrote: >> > >> > Thank you, pushed >> >> > Is it just me or the newly added test in 010_pg_basebackup.pl failing for > others too? > > # Failed

Function to get a txn's replication origin

2018-03-26 Thread Craig Ringer
Hi all During the committs / replorigin split, the function to query the replication origin of a transaction from user space was lost. A function to do so is utterly trivial, e.g. Datum pg_get_xact_replication_origin(PG_FUNCTION_ARGS) { TransactionId xid = PG_GETARG_TRANSACTIONID(0); Tim

Re: new function for tsquery creartion

2018-03-26 Thread Dmitry Ivanov
Recently I worked with the old version of the patch and found a bug. So, I think it is better to notify you immediately, so you can fix it in rebased/revised version. I noticed, that operator AROUND(N) works only in case of non-negative operands. If any of the operands is negative, it behaves

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
Hi, > On 26 Mar 2018, at 05:11, Craig Ringer wrote: > > On 26 March 2018 at 06:00, Damir Simunic wrote: > > > - Overhead for all clients. It may be tiny, but it needs to be > > measured and that cost needs to be weighed against the benefits. > > Maybe a cache miss in the context of a networ

Re: Problem while setting the fpw with SIGHUP

2018-03-26 Thread Dilip Kumar
On Fri, Mar 23, 2018 at 1:19 PM, Michael Paquier wrote: > On Tue, Mar 20, 2018 at 12:00:47PM +0530, Dilip Kumar wrote: > > Yeah, you are right. Fixed. > > So I have been spending a couple of hours playing with your patch, and > tested various configurations manually, like switch the fpw switch t

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Hi, >If anyone finds the idea of Postgres speaking http2 appealing HTTP/2 sounds interesting. What do you think of https://grpc.io/ ? Have you evaluated it? It does sound like a ready RPC on top of HTTP/2 with support for lots of languages. The idea of reimplementing the protocol for multiple l

Replication origins conflate two separate functions

2018-03-26 Thread Craig Ringer
Hi folks During some recent work with a plugin (pglogical) that uses replication origins heavily, it's become apparent that replication origins conflate two orthogonal features into one thing. There's "replication origins (session replay progress tracking)" and "replication origins (per-transactio

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Damir> * What are the criteria for getting this into the core? Craig>Mine would be: +1 There's a relevant list as well: https://github.com/pgjdbc/pgjdbc/blob/master/backend_protocol_v4_wanted_features.md Vladimir

Re: Proposal: http2 wire format

2018-03-26 Thread Craig Ringer
On 26 March 2018 at 17:01, Damir Simunic wrote: > > > - Doesn't break new clients connecting to old servers > > > > Old server sends “Invalid startup packet” and closes the connection; > client’s TLS layer reports an error. Does that count as not breaking new > clients? > > libpq would have to d

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
Hi, > On 26 Mar 2018, at 06:47, Jacob Champion wrote: > > On Sun, Mar 25, 2018 at 8:11 PM, Craig Ringer wrote: >> As others have noted, you'll want to find a way to handle this in the least >> SSL-implementation-specific manner possible. IMO if it can't work with >> OpenSSL, Windows's SSL imple

Re: Parallel Aggregates for string_agg and array_agg

2018-03-26 Thread David Rowley
On 26 March 2018 at 15:26, Stephen Frost wrote: > The header at the top of datumCopy() pretty clearly says that it's for > "non-NULL" datums, yet this function seems to be happily ignoring that > and just trying to use it to copy everything. Perhaps I'm missing > something, but I don't see anythi

Index scan prefetch?

2018-03-26 Thread Konstantin Knizhnik
Hi, hackers. I was faced with the following bad performance use case with Postgres: there is a huge append-only table with serial key (ID) which is permanently appended using multithreaded pgloader. Ideally (if there is no parallel load), this table should be clustered by "ID" key: records ar

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-26 Thread Simon Riggs
On 24 March 2018 at 12:27, Robert Haas wrote: > On Sat, Mar 24, 2018 at 8:16 AM, Robert Haas wrote: >> On Thu, Mar 22, 2018 at 7:13 PM, Peter Geoghegan wrote: >>> While I think this this particular HINT buglet is pretty harmless, I >>> continue to be concerned about the unintended consequences o

Re: WIP: Covering + unique indexes.

2018-03-26 Thread Alexander Korotkov
On Sun, Mar 25, 2018 at 1:47 AM, Peter Geoghegan wrote: > I was going to say that you could just treat the low bit in the t_tid > offset as representing "see catalog entry". My first idea was that > nothing would have to change about the existing format, since internal > page items already have o

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2018-03-26 Thread Dean Rasheed
On 18 March 2018 at 23:57, Tomas Vondra wrote: > Attached is an updated version of the patch series, addressing issues > pointed out by Alvaro. I'm just starting to look at this now, and I think I'll post individual comments/questions as I get to them rather than trying to review the whole thing,

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 11:34, Craig Ringer wrote: > > On 26 March 2018 at 17:01, Damir Simunic > wrote: > > > > - Doesn't break new clients connecting to old servers > > > > Old server sends “Invalid startup packet” and closes the connection; client’s > T

Re: Proposal: http2 wire format

2018-03-26 Thread Craig Ringer
On 26 March 2018 at 17:34, Damir Simunic wrote: > > > As you move forward with the PoC, consider: even if you decide not to > > become protocol-layer experts, you'll still need to become familiar > > with application-layer security in HTTP. > > Good point. Application layer security is indeed a

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 12:47, Craig Ringer wrote: > > On 26 March 2018 at 17:34, Damir Simunic wrote: > > > > As you move forward with the PoC, consider: even if you decide not to > > become protocol-layer experts, you'll still need to become familiar > > with application-layer security in HTTP

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 11:13, Vladimir Sitnikov > wrote: > > Damir> * What are the criteria for getting this into the core? > Craig>Mine would be: > > +1 > > There's a relevant list as well: > https://github.com/pgjdbc/pgjdbc/blob/master/backend_protocol_v4_wanted_features.md > >

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-26 Thread Chapman Flack
On 03/25/18 23:27, Stephen Frost wrote: >> .travis.yml | 47 >> > > ... not something that I think we're going to add into the main tree. Looks like that got in by mistake, sorry. > - AdvanceXLInsertBuffer(CurrPos

Re: new function for tsquery creartion

2018-03-26 Thread Thomas Munro
On Mon, Mar 26, 2018 at 9:51 PM, Dmitry Ivanov wrote: >> Recently I worked with the old version of the patch and found a bug. >> So, I think it is better to notify you immediately, so you can fix it in >> rebased/revised version. >> >> I noticed, that operator AROUND(N) works only >> in case of no

Re: PATCH: Exclude unlogged tables from base backups

2018-03-26 Thread Masahiko Sawada
On Mon, Mar 26, 2018 at 4:52 PM, Pavan Deolasee wrote: > > > On Mon, Mar 26, 2018 at 1:03 PM, Pavan Deolasee > wrote: >> >> On Fri, Mar 23, 2018 at 9:51 PM, David Steele wrote: >>> >>> On 3/23/18 12:14 PM, Teodor Sigaev wrote: >>> > >>> > Thank you, pushed >>> >> >> Is it just me or the newly ad

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-26 Thread Ashutosh Bapat
On Fri, Mar 23, 2018 at 4:35 PM, Jeevan Chalke wrote: > > Changes related to postgres_fdw which allows pushing aggregate on the > foreign server is not yet committed. Due to this, we will end up getting an > error when we have foreign partitions + aggregation. > > Attached 0001 patch here (0006 fr

Re: Faster inserts with mostly-monotonically increasing values

2018-03-26 Thread Andrew Dunstan
On Mon, Mar 26, 2018 at 6:06 PM, Pavan Deolasee wrote: > > > On Sun, Mar 25, 2018 at 6:00 AM, Andrew Dunstan > wrote: >> >> On Fri, Mar 23, 2018 at 8:27 PM, Pavan Deolasee >> wrote: >> >> >> >> >> >> I would probably just have a few regression lines that should be sure >> >> to exercise the code

Re: PATCH: Exclude unlogged tables from base backups

2018-03-26 Thread Pavan Deolasee
On Mon, Mar 26, 2018 at 5:16 PM, Masahiko Sawada wrote: > On Mon, Mar 26, 2018 at 4:52 PM, Pavan Deolasee > > >> > > > > This one-liner patch fixes it for me. > > > > Isn't this issue already fixed by commit > d0c0c894533f906b13b79813f02b2982ac675074? Ah, right. Thanks for pointing out and sorr

Re: PostgreSQL crashes with SIGSEGV

2018-03-26 Thread Kyotaro HORIGUCHI
At Thu, 22 Feb 2018 16:22:47 -0800, Peter Geoghegan wrote in > On Mon, Feb 12, 2018 at 6:15 PM, Peter Geoghegan wrote: > > * For 9.5 and 9.6, the approach taken in bugfix commit d8589946d > > should be taken even further -- we should always copy. Moreover, we > > should always copy within tuple

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-03-26 Thread Marina Polyakova
On 25-03-2018 15:23, Fabien COELHO wrote: Hm, I took a look on both thread about patch and it seems to me now it's overcomplicated. With recently committed enhancements of pgbench (\if, \when) it becomes close to impossible to retry transation in case of failure. So, initial approach just to ro

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Haribabu Kommi
On Mon, Mar 26, 2018 at 6:34 PM, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello. > > At Mon, 26 Mar 2018 17:49:22 +1100, Haribabu Kommi < > kommi.harib...@gmail.com> wrote in sgsfmjgvberjh0n9w8ry24...@mail.gmail.com> > > Thanks for the review. > + The PQhost function

Re: Re: csv format for psql

2018-03-26 Thread Daniel Verite
Pavel Stehule wrote: > implemented in attached patch Consider your initial output of \pset, when no option is specified = $ ./psql psql (11devel) Type "help" for help. postgres=# \pset border 1 columns 0 expanded off fie

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 11:06, Vladimir Sitnikov > wrote: > > Hi, > > >If anyone finds the idea of Postgres speaking http2 appealing > > HTTP/2 sounds interesting. > What do you think of https://grpc.io/ ? > > Have you evaluated it? > It does sound like a ready RPC on top of HTTP/2 with support

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2018-03-26 Thread Tomas Vondra
On 03/26/2018 12:31 PM, Dean Rasheed wrote: > On 18 March 2018 at 23:57, Tomas Vondra wrote: >> Attached is an updated version of the patch series, addressing issues >> pointed out by Alvaro. > > I'm just starting to look at this now, and I think I'll post > individual comments/questions as I

Re: Parallel Aggregates for string_agg and array_agg

2018-03-26 Thread Stephen Frost
Greetings, * David Rowley (david.row...@2ndquadrant.com) wrote: > On 26 March 2018 at 15:26, Stephen Frost wrote: > > The header at the top of datumCopy() pretty clearly says that it's for > > "non-NULL" datums, yet this function seems to be happily ignoring that > > and just trying to use it to

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Michael Paquier
On Mon, Mar 26, 2018 at 11:39:51PM +1100, Haribabu Kommi wrote: > And if we are not going to change the above, then PQhost() function > returns 3 values, > - NULL when the conn==NULL > - Actual host or hostaddr of the active connection > - Empty string when the conn is not able to evaluate. > > Is

Re: Re: WIP: Covering + unique indexes.

2018-03-26 Thread David Steele
On 3/26/18 6:10 AM, Alexander Korotkov wrote: > > So, as I get you're proposing to introduce INDEX_ALT_TID_MASK flag > which would indicate that we're storing something special in the t_tid > offset.  And that should help us not only for covering indexes, but also for > further btree enhancements

Re: Re: csv format for psql

2018-03-26 Thread Pavel Stehule
2018-03-26 14:44 GMT+02:00 Daniel Verite : > Pavel Stehule wrote: > > > implemented in attached patch > > Consider your initial output of \pset, when no option is specified > = > $ ./psql > psql (11devel) > Type "help" for help. > > postgres=# \pset > border

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-26 Thread Amit Kapila
On Sun, Mar 25, 2018 at 12:47 AM, Tom Lane wrote: > Claudio Freire writes: >> [ 0001-Vacuum-Update-FSM-more-frequently-v9.patch ] > > I hadn't paid any attention to this patch previously, so maybe I'm > missing something ... but this sure seems like a very bizarre approach > to the problem. If t

Re: WIP: a way forward on bootstrap data

2018-03-26 Thread John Naylor
On 3/25/18, Tom Lane wrote: > Well, as I said, I hadn't really reviewed the .dat files, but if that's > what you're doing I'm going to request a change. Project style is to > fit in 80 columns as much as possible. I do not see a reason to exempt > the .dat files from that, especially not since i

Re: Parallel Aggregates for string_agg and array_agg

2018-03-26 Thread David Rowley
On 27 March 2018 at 02:20, Stephen Frost wrote: > Just to be clear- the segfault is just happening with your patch and > you're just contemplating having string_agg always allocate state on the > first call, similar to what int8_avg_accum() does? > > If so, then, yes, that seems alright to me. I

Re: [HACKERS] pg_upgrade to clusters with a different WAL segment size

2018-03-26 Thread Bossart, Nathan
On 3/25/18, 2:02 PM, "Peter Eisentraut" wrote: > committed Thanks! Nathan

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-26 Thread Claudio Freire
On Sat, Mar 24, 2018 at 4:17 PM, Tom Lane wrote: > Claudio Freire writes: >> [ 0001-Vacuum-Update-FSM-more-frequently-v9.patch ] > > I hadn't paid any attention to this patch previously, so maybe I'm > missing something ... but this sure seems like a very bizarre approach > to the problem. If th

Re: Direct converting numeric types to bool

2018-03-26 Thread n . zhuchkov
Thanks for your feedback! Really, support migration from Oracle isn't the best argumentation for this patch. Yes, in postgres already exists int::boolean casting and in case: select 10::bigint::int::boolean; it will perfectly work. But if you want to cast more significant number: select (2^32

Re: Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2018-03-26 Thread David Steele
On 3/7/18 5:43 AM, Alvaro Herrera wrote: > > At this point I'm not sure what to do with this patch. It needs a lot > of further work, for which I don't have time now, and given the pressure > we're under I think we should punt it to the next dev cycle. > > Here's a rebased pgindented version. I

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-26 Thread Tom Lane
Claudio Freire writes: > On Sat, Mar 24, 2018 at 4:17 PM, Tom Lane wrote: >> I hadn't paid any attention to this patch previously, so maybe I'm >> missing something ... but this sure seems like a very bizarre approach >> to the problem. If the idea is to fix the FSM's upper levels after >> vacuu

Re: Re: [PATCH] Add missing type conversion functions for PL/Python

2018-03-26 Thread David Steele
On 2/20/18 10:14 AM, Haozhou Wang wrote: > Thank you very much for your review! > > I attached a new patch with typo fixed. I think it's a bit premature to mark this Ready for Committer after a review consisting of a few typos. Anthony only said that he started looking at it so I've marked it Ne

Re: ON CONFLICT DO UPDATE for partitioned tables

2018-03-26 Thread Alvaro Herrera
Pushed now. Amit Langote wrote: > On 2018/03/24 9:23, Alvaro Herrera wrote: > > To fix this, I had to completely rework the "get partition parent root" > > stuff into "get list of ancestors of this partition". > > I wondered if a is_partition_ancestor(partrelid, ancestorid) isn't enough > instea

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-26 Thread Claudio Freire
On Mon, Mar 26, 2018 at 11:19 AM, Tom Lane wrote: > Claudio Freire writes: >> On Sat, Mar 24, 2018 at 4:17 PM, Tom Lane wrote: >>> I hadn't paid any attention to this patch previously, so maybe I'm >>> missing something ... but this sure seems like a very bizarre approach >>> to the problem. If

Re: Proposal: http2 wire format

2018-03-26 Thread Tom Lane
Damir Simunic writes: >> On 26 Mar 2018, at 11:06, Vladimir Sitnikov >> wrote: >>> If anyone finds the idea of Postgres speaking http2 appealing TBH, this sounds like a proposal to expend a whole lot of work (much of it outside the core server, and thus not under our control) in order to get fr

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-26 Thread Simon Riggs
On 26 March 2018 at 15:39, Pavan Deolasee wrote: > Now that ON CONFLICT patch is in, here are rebased patches. The second patch > is to add support for CTE (thanks Peter). > > Apart from rebase, the following things are fixed/improved: > > - Added test cases for column level privileges as suggest

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-26 Thread Robert Haas
On Mon, Mar 26, 2018 at 5:53 AM, Simon Riggs wrote: > Since we now have MVCC catalog scans, all the name lookups are > performed using the same snapshot so in the above scenario the newly > created object would be invisible to the second name lookup. That's not true, because each lookup would be

Re: bugfifx: a minor mistake in brin_inclusion.c comment

2018-03-26 Thread Alvaro Herrera
Tomas Vondra wrote: > Hi, > > while looking at brin_inclusion.c, I've noticed that the comment about > INCLUSION_UNMERGEABLE and INCLUSION_CONTAINS_EMPTY uses incorrect values > (1 instead of 2). Attached is a simple fix. Uh, yeah, this is wrong. > But perhaps it would be better to use the const

Re: Direct converting numeric types to bool

2018-03-26 Thread Tom Lane
n.zhuch...@postgrespro.ru writes: > Yes, in postgres already exists int::boolean casting and in case: > select 10::bigint::int::boolean; > it will perfectly work. But if you want to cast more significant number: > select (2^32)::bigint::int::boolean; > you receive the boundary value error. Right.

Re: Why does load_external_function() return PGFunction?

2018-03-26 Thread Robert Haas
On Sat, Mar 24, 2018 at 4:33 PM, Andres Freund wrote: > I don't think it really changes the need, but it's worthwhile to note > that gcc-8 warns about this now: > /home/andres/src/postgresql/src/backend/postmaster/bgworker.c: In function > ‘LookupBackgroundWorkerFunction’: > /home/andres/src/post

Re: [PROPOSAL] Shared Ispell dictionaries

2018-03-26 Thread Tom Lane
Arthur Zakirov writes: > On Sun, Mar 25, 2018 at 12:18:10AM -0400, Tom Lane wrote: >> My thought was (a) the ROLLBACK case is ok, because the next use of >> the dictionary will reload it, and (b) the reload-concurrently-with- >> DROP case is annoying, because indeed it leaks, but the window is sma

Re: pgbench randomness initialization

2018-03-26 Thread Teodor Sigaev
Thank you, pushed Fabien COELHO wrote: Patch isn't applyed cleanly anymore. Indeed. Here is a rebase. All pgbench patches conflict about test cases. Patch v12, yet another rebase. -- Teodor Sigaev E-mail: teo...@sigaev.ru

Re: WIP: a way forward on bootstrap data

2018-03-26 Thread John Naylor
With the attachments this time. -John Naylor #-- # # pg_aggregate.dat #Initial contents of the pg_aggregate system relation. # # Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group # Portions Copyright (c) 19

Re: WIP: a way forward on bootstrap data

2018-03-26 Thread Tom Lane
John Naylor writes: > With the attachments this time. Layout of .dat files seems generally reasonable, but I don't understand the proposed make rule: +reformat-dat-files: + $(PERL) -I $(catalogdir) $< catalog/rewrite_dat.pl -o catalog catalog/pg_*.dat This rule has no prerequisite, so wh

Re: PATCH: Exclude temp relations from base backup

2018-03-26 Thread Teodor Sigaev
Hi! Will autovacuum (or something else) complain about absense of relfile during orphan table deleting? I mean, you get a base backup without temp tables, then you try to run postgres on it and will it complain about existing record in pg_class and absence of corresponding relfile? David St

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-03-26 Thread Fabien COELHO
Hello Marina, Many thanks to both of you! I'm working on a patch in this direction.. I think that the best approach for now is simply to reset (command zero, random generator) and start over the whole script, without attempting to be more intelligent. The limitations should be clearly documen

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-26 Thread Simon Riggs
On 26 March 2018 at 15:39, Pavan Deolasee wrote: > reviewer 1. In ExecMergeMatched() we have a line of code that does this... if (TransactionIdIsCurrentTransactionId(hufd.xmax)) then errcode(ERRCODE_CARDINALITY_VIOLATION) I notice this is correct, but too strong. It should be possible to run a

Re: [PATCH] Add missing type conversion functions for PL/Python

2018-03-26 Thread Nikita Glukhov
On 26.03.2018 17:19, David Steele wrote: On 2/20/18 10:14 AM, Haozhou Wang wrote: Thank you very much for your review! I attached a new patch with typo fixed. I think it's a bit premature to mark this Ready for Committer after a review consisting of a few typos. Anthony only said that he sta

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Damir>Postgres doesn’t know about grpc, s I'm afraid you are missing the point. I would say PostgreSQL doesn't know about HTTP/2. It is the same as "PostgreSQL doesn't know about grpc". Here's a quote from your pg_h2 repo: >What we need is to really build a request object and correctly extract >

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-26 Thread Simon Riggs
On 26 March 2018 at 16:09, Robert Haas wrote: > On Mon, Mar 26, 2018 at 5:53 AM, Simon Riggs wrote: >> Since we now have MVCC catalog scans, all the name lookups are >> performed using the same snapshot so in the above scenario the newly >> created object would be invisible to the second name loo

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Tom>But starting from the assumption that HTTP2 solves our problems seems to me to be "Here's a hammer. Agree. Just a side note: if v4 is ever invented I wish client language support is considered. It does take resources to implement message framing, and data parsing (e.g. int, timestamp, struct,

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2018-03-26 Thread Dean Rasheed
On 26 March 2018 at 14:08, Tomas Vondra wrote: > On 03/26/2018 12:31 PM, Dean Rasheed wrote: >> A wider concern I have is that I think this function is trying to be >> too clever by only resetting selected stats. IMO it should just reset >> all stats unconditionally when the column type changes, w

Re: Using base backup exclusion filters to reduce data transferred with pg_rewind

2018-03-26 Thread Fujii Masao
On Sun, Mar 25, 2018 at 5:06 PM, Michael Paquier wrote: > On Sat, Mar 24, 2018 at 11:14:34PM -0400, Tom Lane wrote: >> Stephen Frost writes: >>> I don't completely buy off on the argument that having these #define's >>> would make it easier for forks (we've had quite a few folks fork PG, but >>>

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-26 Thread Tom Lane
Chapman Flack writes: > On 03/25/18 23:27, Stephen Frost wrote: >> AdvanceXLInsertBuffer() does quite a bit, so I'm a bit surprised to see >> this simply removing that call, you're confident there's nothing done >> which still needs doing..? > My belief from looking at the code was that AdvanceXL

Re: new function for tsquery creartion

2018-03-26 Thread Dmitry Ivanov
Patch 03 (the documentation) needed some proof-reading. I've attached a new version of that patch with some small suggested improvements. Thanks, I'm definitely going to use this. Is there anything to_tsquery() can do that websearch_to_tsquery() can't? Currently, no. Would it be OK to use

Re: [HACKERS] pg_serial early wraparound

2018-03-26 Thread Tom Lane
Thomas Munro writes: > Rebased again, now with a commit message. That assertion has since > been removed (commit ec99dd5a) so the attached test script can once > again be used to see the contents of pg_serial as the xid goes all the > way around, if you build with TEST_OLDSERXID defined so that >

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-26 Thread Robert Haas
On Mon, Mar 26, 2018 at 12:16 PM, Simon Riggs wrote: > On 26 March 2018 at 16:09, Robert Haas wrote: >> On Mon, Mar 26, 2018 at 5:53 AM, Simon Riggs wrote: >>> Since we now have MVCC catalog scans, all the name lookups are >>> performed using the same snapshot so in the above scenario the newly

Re: PATCH: Exclude temp relations from base backup

2018-03-26 Thread Stephen Frost
Greetings, * Teodor Sigaev (teo...@sigaev.ru) wrote: > Will autovacuum (or something else) complain about absense of relfile during > orphan table deleting? I mean, you get a base backup without temp tables, > then you try to run postgres on it and will it complain about existing > record in pg_cl

Re: PATCH: Exclude temp relations from base backup

2018-03-26 Thread David Steele
On 3/26/18 1:06 PM, Stephen Frost wrote: > > * Teodor Sigaev (teo...@sigaev.ru) wrote: >> Will autovacuum (or something else) complain about absense of relfile during >> orphan table deleting? I mean, you get a base backup without temp tables, >> then you try to run postgres on it and will it comp

Re: WIP: a way forward on bootstrap data

2018-03-26 Thread John Naylor
> On Mar 26, 2018, at 10:44 PM, Tom Lane wrote > Layout of .dat files seems generally reasonable, but I don't understand > the proposed make rule: > > +reformat-dat-files: > +$(PERL) -I $(catalogdir) $< catalog/rewrite_dat.pl -o catalog > catalog/pg_*.dat > > This rule has no prerequisit

Re: Proposal: http2 wire format

2018-03-26 Thread Alvaro Hernandez
On 26/03/18 13:11, Damir Simunic wrote: On 26 Mar 2018, at 11:13, Vladimir Sitnikov mailto:sitnikov.vladi...@gmail.com>> wrote: Damir> * What are the criteria for getting this into the core? Craig>Mine would be: +1 There's a relevant list as well: https://github.com/pgjdbc/pgjdbc/blob/mast

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-26 Thread Claudio Freire
On Mon, Mar 26, 2018 at 11:26 AM, Claudio Freire wrote: > On Mon, Mar 26, 2018 at 11:19 AM, Tom Lane wrote: >> Claudio Freire writes: >>> On Sat, Mar 24, 2018 at 4:17 PM, Tom Lane wrote: I hadn't paid any attention to this patch previously, so maybe I'm missing something ... but this

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-26 Thread Claudio Freire
On Mon, Mar 26, 2018 at 2:46 PM, Claudio Freire wrote: > On Mon, Mar 26, 2018 at 11:26 AM, Claudio Freire > wrote: >> On Mon, Mar 26, 2018 at 11:19 AM, Tom Lane wrote: >>> Claudio Freire writes: On Sat, Mar 24, 2018 at 4:17 PM, Tom Lane wrote: > I hadn't paid any attention to this pa

Re: Re: csv format for psql

2018-03-26 Thread Daniel Verite
Pavel Stehule wrote: > b) the list of pset options is bloating - every possible new format can > introduce fieldsep_X option What new format? The usefulness of fieldsep does not extend outside of xSV, and it's no suprise that there have been no other use for a fieldsep-like variable until

Re: Why does load_external_function() return PGFunction?

2018-03-26 Thread Andres Freund
On 2018-03-26 11:14:03 -0400, Robert Haas wrote: > On Sat, Mar 24, 2018 at 4:33 PM, Andres Freund wrote: > > I don't think it really changes the need, but it's worthwhile to note > > that gcc-8 warns about this now: > > /home/andres/src/postgresql/src/backend/postmaster/bgworker.c: In function >

Re: Why does load_external_function() return PGFunction?

2018-03-26 Thread Andres Freund
Hi, On 2018-02-06 15:43:29 -0500, Tom Lane wrote: > void* isn't necessarily compatible with function pointers --- there are > platforms where they're physically different widths, though possibly > you'd never get PG to run on such hardware anyway. Btw, given that we store function pointers in dat

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 16:56, Tom Lane wrote: > > Damir Simunic writes: >>> On 26 Mar 2018, at 11:06, Vladimir Sitnikov >>> wrote: If anyone finds the idea of Postgres speaking http2 appealing > > TBH, this sounds like a proposal to expend a whole lot of work (much of it > outside the cor

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 18:19, Vladimir Sitnikov > wrote: > > Tom>But starting from the assumption that HTTP2 solves our problems seems to > me to be "Here's a hammer. > > Agree. Funny you agree with that—for someone having the experience of writing a driver and having a long list of things th

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 15:42, Alvaro Hernandez wrote: > > > > On 26/03/18 13:11, Damir Simunic wrote: >>> On 26 Mar 2018, at 11:13, Vladimir Sitnikov >> > wrote: >>> >>> Damir> * What are the criteria for getting this into the core? >>> Craig>Mine would be:

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2018-03-26 Thread Dean Rasheed
On 18 March 2018 at 23:57, Tomas Vondra wrote: > Attached is an updated version of the patch series, addressing issues > pointed out by Alvaro. I've just been reading the new code in statext_clauselist_selectivity() and mcv_clauselist_selectivity(), and I'm having a hard time convincing myself th

Re: Proposal: http2 wire format

2018-03-26 Thread Andres Freund
Hi, On 2018-03-26 20:36:09 +0200, Damir Simunic wrote: > If so, I’m not suggesting we get rid of FEBE, but leave it as is and > complement it with a widely understood and supported protocol, that in fact > takes compatibility way more seriously than FEBE. Just leave v3 frozen. Seems > like ulti

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2018-03-26 Thread Tomas Vondra
On 03/26/2018 06:21 PM, Dean Rasheed wrote: > On 26 March 2018 at 14:08, Tomas Vondra wrote: >> On 03/26/2018 12:31 PM, Dean Rasheed wrote: >>> A wider concern I have is that I think this function is trying to be >>> too clever by only resetting selected stats. IMO it should just reset >>> all st

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-26 Thread Simon Riggs
On 26 March 2018 at 17:52, Robert Haas wrote: > On Mon, Mar 26, 2018 at 12:16 PM, Simon Riggs wrote: >> On 26 March 2018 at 16:09, Robert Haas wrote: >>> On Mon, Mar 26, 2018 at 5:53 AM, Simon Riggs wrote: Since we now have MVCC catalog scans, all the name lookups are performed using

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2018-03-26 Thread Tomas Vondra
On 03/26/2018 09:01 PM, Dean Rasheed wrote: > On 18 March 2018 at 23:57, Tomas Vondra wrote: >> Attached is an updated version of the patch series, addressing issues >> pointed out by Alvaro. > > I've just been reading the new code in > statext_clauselist_selectivity() and mcv_clauselist_select

Re: Why does load_external_function() return PGFunction?

2018-03-26 Thread Tom Lane
Andres Freund writes: > On 2018-02-06 15:43:29 -0500, Tom Lane wrote: >> void* isn't necessarily compatible with function pointers --- there are >> platforms where they're physically different widths, though possibly >> you'd never get PG to run on such hardware anyway. > Btw, given that we store

Re: committing inside cursor loop

2018-03-26 Thread Peter Eisentraut
On 3/19/18 20:40, Peter Eisentraut wrote: > On 3/14/18 08:05, Ildus Kurbangaliev wrote: >>> The ROLLBACK call in the first loop iteration undoes the UPDATE >>> command that drives the loop. Is it then sensible to continue the >>> loop? >>> >> I think that in the first place ROLLBACK was prohibited

Re: Re: csv format for psql

2018-03-26 Thread Pavel Stehule
2018-03-26 20:26 GMT+02:00 Daniel Verite : > Pavel Stehule wrote: > > > b) the list of pset options is bloating - every possible new format can > > introduce fieldsep_X option > > What new format? > The usefulness of fieldsep does not extend outside of xSV, and it's > no suprise that there

Re: WIP: Covering + unique indexes.

2018-03-26 Thread Peter Geoghegan
On Mon, Mar 26, 2018 at 3:10 AM, Alexander Korotkov wrote: > So, as I get you're proposing to introduce INDEX_ALT_TID_MASK flag > which would indicate that we're storing something special in the t_tid > offset. And that should help us not only for covering indexes, but also for > further btree en

Re: Index scan prefetch?

2018-03-26 Thread Justin Pryzby
On Mon, Mar 26, 2018 at 12:43:02PM +0300, Konstantin Knizhnik wrote: > Hi, hackers. > > I was faced with the following bad performance use case with Postgres: there > is a huge append-only table with serial key (ID) > which is permanently appended using multithreaded pgloader. I think this could

Re: JIT compiling with LLVM v12.2

2018-03-26 Thread Andres Freund
Hi, On 2018-03-25 00:07:11 +1300, Thomas Munro wrote: > I spotted a couple of typos and some very minor coding details -- see > please see attached. Thanks, applying 0001 in a bit. > From 648e303072c77e781eca2bb06f488f6be9ccac84 Mon Sep 17 00:00:00 2001 > From: Thomas Munro > Date: Sat, 24 Mar

Re: Proposal: http2 wire format

2018-03-26 Thread Damir Simunic
> On 26 Mar 2018, at 18:09, Vladimir Sitnikov > wrote: > > Damir>Postgres doesn’t know about grpc, s > > I'm afraid you are missing the point. > I would say PostgreSQL doesn't know about HTTP/2. > It is the same as "PostgreSQL doesn't know about grpc". > > Here's a quote from your pg_h2 repo:

Re: Why does load_external_function() return PGFunction?

2018-03-26 Thread Andres Freund
On 2018-03-26 15:26:00 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-02-06 15:43:29 -0500, Tom Lane wrote: > >> void* isn't necessarily compatible with function pointers --- there are > >> platforms where they're physically different widths, though possibly > >> you'd never get PG to

Re: Online enabling of checksums

2018-03-26 Thread Tomas Vondra
Hi, I see enable_data_checksums() does this: if (cost_limit <= 0) ereport(ERROR, (errmsg("cost limit must be a positive value"))); Is there a reason not to allow -1 (no limit), just like for vacuum_cost? regards -- Tomas Vondra http://www.2ndQuadr

  1   2   >