Re: pgsql: Allow insert and update tuple routing and COPY for foreign table

2019-04-21 Thread Amit Langote
Hi, On 2019/04/20 20:53, Laurenz Albe wrote: > On Fri, 2018-04-06 at 23:24 +, Robert Haas wrote: >> Allow insert and update tuple routing and COPY for foreign tables. >> >> Also enable this for postgres_fdw. >> >> Etsuro Fujita, based on an earlier patch by Amit Langote. The larger >> patch se

Re: pgsql: Allow insert and update tuple routing and COPY for foreign table

2019-04-21 Thread Etsuro Fujita
(2019/04/20 20:53), Laurenz Albe wrote: On Fri, 2018-04-06 at 23:24 +, Robert Haas wrote: Allow insert and update tuple routing and COPY for foreign tables. Also enable this for postgres_fdw. Etsuro Fujita, based on an earlier patch by Amit Langote. The larger patch series of which this is

Re: clean up docs for v12

2019-04-21 Thread Michael Paquier
On Fri, Apr 19, 2019 at 09:43:01AM -0500, Justin Pryzby wrote: > Thanks for committing those portions. I have done an extra pass on your patch set to make sure that I am missing nothing, and the last two remaining places which need some tweaks are the comments from the JIT code you pointed out. A

Re: Runtime pruning problem

2019-04-21 Thread Amit Langote
On 2019/04/21 15:25, David Rowley wrote: > On Fri, 19 Apr 2019 at 20:01, Amit Langote > wrote: >> Another approach, as I mentioned above, is to extend the hack that begins >> in nodeAppend.c (and nodeMergeAppend.c) into explain.c, as in the >> attached. Then: >> >> explain verbose select * from t

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2019-04-21 Thread Paul Guo
Please see my replies inline. Thanks. On Fri, Apr 19, 2019 at 12:38 PM Asim R P wrote: > On Wed, Apr 17, 2019 at 1:27 PM Paul Guo wrote: > > > > create db with tablespace > > drop database > > drop tablespace. > > Essentially, that sequence of operations causes crash recovery to fail > if the "

Re: [PATCH v1] Add \echo_stderr to psql

2019-04-21 Thread Corey Huinker
> > >\warn ... >\warning ... > These two seem about the best to me, drawing from the perl warn command. I suppose we could go the bash &2 route here, but I don't want to.

Re: extensions are hitting the ceiling

2019-04-21 Thread Noah Misch
On Tue, Apr 16, 2019 at 04:24:20AM -0500, Eric Hanson wrote: > On Tue, Apr 16, 2019 at 12:47 AM Noah Misch wrote: > > https://www.postgresql.org/message-id/20180710014308.ga805...@rfd.leadboat.com > > > > The @DEPNAME_schema@ thing was trivial to implement, but I shelved it. > > I'm attaching the

Re: [PATCH v20] GSSAPI encryption support

2019-04-21 Thread Michael Paquier
On Fri, Apr 19, 2019 at 09:25:14PM -0400, Stephen Frost wrote: > Great, glad to hear it. What you have committed looks fine seen from here. Thanks for taking care of the issue, Stephen. -- Michael signature.asc Description: PGP signature

Re: finding changed blocks using WAL scanning

2019-04-21 Thread Michael Paquier
On Sat, Apr 20, 2019 at 12:21:36AM -0400, Robert Haas wrote: > The segment size doesn't have much to do with it. If you make > segments bigger, you'll have to scan fewer larger ones; if you make > them smaller, you'll have more smaller ones. The only thing that > really matters is the amount of I

Thoughts on nbtree with logical/varwidth table identifiers, v12 on-disk representation

2019-04-21 Thread Peter Geoghegan
Andres has suggested that I work on teaching nbtree to accommodate variable-width, logical table identifiers, such as those required for indirect indexes, or clustered indexes, where secondary indexes must use a logical primary key value instead of a heap TID. I'm not currently committed to working

Re: jsonpath

2019-04-21 Thread Alvaro Herrera
On 2019-Apr-22, Alexander Korotkov wrote: > Hi! > > Thank you for your review! > > On Mon, Apr 22, 2019 at 1:39 AM Tom Lane wrote: > > Alexander Korotkov writes: > > RETURN_ERROR(ereport(ERROR, > > (errcode(ERRCODE_JSON_ARRAY_NOT_FOUND), > >

Re: jsonpath

2019-04-21 Thread Tom Lane
Alexander Korotkov writes: > Just to clarify things. Do you propose to get rid of RETURN_ERROR() > macro by expanding it at every occurrence? Or do you have other ideas > in the mind? I wasn't really complaining about RETURN_ERROR() --- it was the macros rather than literal strings for the errm

Re: jsonpath

2019-04-21 Thread John Naylor
On Sun, Apr 21, 2019 at 2:01 AM Alexander Korotkov wrote: > > On Thu, Apr 18, 2019 at 4:09 AM John Naylor > wrote: > > I was wondering about that. I measured the current size of > > yy_transition to be 36492 on my machine. With the flag -Cfe, which > > gives the smallest representation without b

Re: jsonpath

2019-04-21 Thread Alexander Korotkov
Hi! Thank you for your review! On Mon, Apr 22, 2019 at 1:39 AM Tom Lane wrote: > Alexander Korotkov writes: > RETURN_ERROR(ereport(ERROR, > (errcode(ERRCODE_JSON_ARRAY_NOT_FOUND), > errmsg(ERRMSG_JSON_ARR

Re: block-level incremental backup

2019-04-21 Thread Robert Haas
On Sat, Apr 20, 2019 at 4:32 PM Stephen Frost wrote: > Having been around for a while working on backup-related things, if I > was to implement the protocol for pg_basebackup today, I'd definitely > implement "give me a list" and "give me this file" rather than the > tar-based approach, because I'

Re: jsonpath

2019-04-21 Thread Tom Lane
Alexander Korotkov writes: >> On Wed, Apr 17, 2019 at 8:43 PM Tom Lane wrote: >>> Yeah, I'd noticed that one too :-(. I think the whole jsonpath patch >>> needs a sweep to bring its error messages into line with our style >>> guidelines, but no harm in starting with the obvious bugs. > I went t

Re: finding changed blocks using WAL scanning

2019-04-21 Thread Robert Haas
On Sat, Apr 20, 2019 at 5:54 PM Bruce Momjian wrote: > Good point. You mentioned: > > It seems better to me to give the files names like > ${TLI}.${STARTLSN}.${ENDLSN}.modblock, e.g. > 0001.00016858.0001687DBBB8.modblock, so that you can > see exact

Re: [PATCH v1] Add \echo_stderr to psql

2019-04-21 Thread David Fetter
On Sun, Apr 21, 2019 at 09:31:16PM +0200, Fabien COELHO wrote: > > Any interest in this? > > Yep, although I'm not sure of the suggested command name. More suggestions: > \stderr ... > \err ... > \error ... > \warn ... > \warning ... Naming Things is one of the two[1] hard problems in C

Re: ALTER TABLE with ADD COLUMN and ADD PRIMARY KEY USING INDEX throws spurious "column contains null values"

2019-04-21 Thread Tom Lane
Robert Haas writes: > On Wed, Apr 17, 2019 at 11:55 PM Tom Lane wrote: >> * I'm not sure whether we want to try to back-patch this, or how >> far it should go. The misbehavior has been there a long time >> (at least back to 8.4, I didn't check further); so the lack of >> previous reports means p

Re: Odd behavior of partitioned ALTER TABLE ONLY ... ADD PRIMARY KEY

2019-04-21 Thread Tom Lane
Alvaro Herrera writes: > On 2019-Apr-21, Tom Lane wrote: >> ISTM that this is a bug, not a feature: if there's any point at >> all to saying ONLY in this context, it's that we're not supposed >> to be doing anything as expensive as adding a new constraint to >> a child partition. No? So I think

Re: Odd behavior of partitioned ALTER TABLE ONLY ... ADD PRIMARY KEY

2019-04-21 Thread Alvaro Herrera
On 2019-Apr-21, Tom Lane wrote: > ISTM that this is a bug, not a feature: if there's any point at > all to saying ONLY in this context, it's that we're not supposed > to be doing anything as expensive as adding a new constraint to > a child partition. No? So I think that this should have failed.

Re: [PATCH v1] Add \echo_stderr to psql

2019-04-21 Thread Fabien COELHO
Any interest in this? Yep, although I'm not sure of the suggested command name. More suggestions: \stderr ... \err ... \error ... \warn ... \warning ... -- Fabien.

Odd behavior of partitioned ALTER TABLE ONLY ... ADD PRIMARY KEY

2019-04-21 Thread Tom Lane
While fooling around with the patch shown at <12166.159...@sss.pgh.pa.us>, I noticed this rather strange pre-existing behavior (tested on v11 as well as HEAD): regression=# create table idxpart (a int) partition by range (a); CREATE TABLE regression=# create table idxpart0 (like idxpart); CREA

Re: [PATCH v1] Add \echo_stderr to psql

2019-04-21 Thread Pavel Stehule
ne 21. 4. 2019 v 20:31 odesílatel David Fetter napsal: > Folks, > > Any interest in this? > has sense Pavel > Best, > David. > -- > David Fetter http://fetter.org/ > Phone: +1 415 235 3778 > > Remember to vote! > Consider donating to Postgres: http://www.postgresql.org/about/donate >

Re: Strange coding in mvdistinct.c

2019-04-21 Thread Tomas Vondra
On Mon, Apr 15, 2019 at 06:12:24PM -0400, Tom Lane wrote: Oh, and as I continue to grep, I found this in dependencies.c: dependencies = (MVDependencies *) repalloc(dependencies, offsetof(MVDependencies, deps)

[PATCH v1] Add \echo_stderr to psql

2019-04-21 Thread David Fetter
Folks, Any interest in this? Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate >From 089d48c00ffa6dfd0a6a443e83f6d618c9847deb Mon Sep 17 00:00:00 2001 From: David Fetter Date: Sun, 21

Re: Do PostgreSQL have map and set structure(like STL in C++)?

2019-04-21 Thread Andrey Borodin
Hello Liu! > 21 апр. 2019 г., в 17:32, 梦旅人 написал(а): >I want to add a feature in PostgreSQL, and I need use map structure and > set structure(like STL in C++). Do PostgreSQL have realized these structures? > Where can I find the functions? > What I need in the code is just like this:

Re: Do PostgreSQL have map and set structure(like STL in C++)?

2019-04-21 Thread Fabien COELHO
Hello, I want to add a feature in PostgreSQL, and I need use map structure and set structure(like STL in C++). Do PostgreSQL have realized these structures? Where can I find the functions? What I need in the code is just like this: map>, set You are looking for a hash table, see under "src

Re: Global snapshots

2019-04-21 Thread Andrey Borodin
Hi! > 30 нояб. 2018 г., в 18:00, Stas Kelvich написал(а): > > > <0001-GlobalCSNLog-SLRU-v3.patch><0002-Global-snapshots-v3.patch><0003-postgres_fdw-support-for-global-snapshots-v3.patch> In spite of recent backup discussions I realized that we need to backup clusters even if they provide glob

Re: [HACKERS] Weaker shmem interlock w/o postmaster.pid

2019-04-21 Thread Noah Misch
On Thu, Apr 18, 2019 at 04:30:46PM +1200, Thomas Munro wrote: > On Thu, Apr 11, 2019 at 6:22 PM Noah Misch wrote: > > - my $iaddr = inet_aton($test_localhost); > > + my $iaddr = inet_aton('0.0.0.0'); > > This causes make check-world to deliver a flurry

Do PostgreSQL have map and set structure(like STL in C++)?

2019-04-21 Thread ??????
Dear PostgreSQL Community:I want to add a feature in PostgreSQL, and I need use map structure and set structure(like STL in C++). Do PostgreSQL have realized these structures? Where can I find the functions? What I need in the code is just like this: map > set Thank you, Liu Baozh

Re: TM format can mix encodings in to_char()

2019-04-21 Thread Tom Lane
Andrew Dunstan writes: > On 4/21/19 12:28 AM, Tom Lane wrote: >> I don't have any way to test this on Windows, so could somebody >> do that? Manually running the Turkish test cases ought to be enough. > How does one do that? Just set a Turkish locale? Try variants of the original test case. Fo

Re: TM format can mix encodings in to_char()

2019-04-21 Thread Andrew Dunstan
On 4/21/19 12:28 AM, Tom Lane wrote: > I wrote: >> [ fix-encoding-and-error-recovery-in-cache-locale-time.patch ] > On closer inspection, I'm pretty sure either version of this patch > will break things on Windows, because that platform already had code > to convert the result of wcsftime() to th

Re: block-level incremental backup

2019-04-21 Thread Andrey Borodin
> 21 апр. 2019 г., в 1:13, Robert Haas написал(а): > > On Sat, Apr 20, 2019 at 12:44 PM Andrey Borodin wrote: >> Incremental backup of 1Tb DB made with distance of few minutes (small change >> set) is few Gbs. All of this size is made of FSM (no LSN) and VM (hard to >> use LSN). >> Sure, th