Re: [HACKERS] INSERT ... ON CONFLICT UPDATE/IGNORE 4.0, parser/executor stuff

2015-04-28 Thread Andres Freund
On 2015-04-27 23:52:58 +0200, Andres Freund wrote: > On 2015-04-27 16:28:49 +0200, Andres Freund wrote: > > On 2015-04-26 18:02:06 -0700, Peter Geoghegan wrote: > > > * So far, there has been a lack of scrutiny about what the patch does > > > in the rewriter (in particular, to support the EXCLUDED.

Re: [HACKERS] Fwd: [GENERAL] 4B row limit for CLOB tables

2015-04-28 Thread José Luis Tallón
On 04/27/2015 08:49 AM, Jim Nasby wrote: On 4/25/15 1:19 PM, Bruce Momjian wrote: Note if you are storing a table with rows that exceed 2KB in size (aggregate size of each row) then the "Maximum number of rows in a table" may be limited to 4 Billion, see TOAST. That's not accurate

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Etsuro Fujita
On 2015/04/28 15:17, Amit Langote wrote: The code at the beginning of ATSimpleRecursion() looks like - /* * Propagate to children if desired. Non-table relations never have * children, so no need to search in that case. */ if (recurse && rel->rd_rel->relkind == RELKIND_RELATION) Not su

Re: [HACKERS] Parallel Seq Scan

2015-04-28 Thread Robert Haas
On Fri, Apr 24, 2015 at 8:32 AM, Amit Kapila wrote: >> - InitializeParallelWorkers() still mixes together general parallel >> executor concerns with concerns specific to parallel sequential scan >> (e.g. EstimatePartialSeqScanSpace). > > Here we are doing 2 things, first one is for planned stateme

Re: [HACKERS] Freeze avoidance of very large table.

2015-04-28 Thread Robert Haas
On Fri, Apr 24, 2015 at 4:09 PM, Jim Nasby wrote:>>> When I read that I think about something configurable at >>> relation-level.There are cases where you may want to have more >>> granularity of this information at block level by having the VM slots >>> to track less blocks than 32, and vice-vers

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Amit Langote
On Tue, Apr 28, 2015 at 8:45 PM, Etsuro Fujita wrote: > On 2015/04/28 15:17, Amit Langote wrote: > > Yeah, I think we should now allow the recursion for inheritance parents that > are foreign tables as well. Attached is a patch for that. > Thanks! >> An example, >> postgres=# alter foreign tabl

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread David Fetter
On Tue, Apr 28, 2015 at 03:17:08PM +0900, Amit Langote wrote: > > Hi, > > Following ALTER TABLE actions are applied recursively to inheritance > descendents via ATSimpleRecursion() - > > ALTER COLUMN DEFAULT > ALTER COLUMN DROP NOT NULL > ALTER COLUMN SET NOT NULL > ALTER COLUMN SET STATISTICS >

Re: [HACKERS] Improving vacuum/VM/etc

2015-04-28 Thread Robert Haas
On Fri, Apr 24, 2015 at 4:11 PM, Jim Nasby wrote: > [ lots of discussion of various states ] This is pretty confused, because you are conflating whether a page is hinted and/or frozen with whether there are dead tuples on it. Those two things are entirely unrelated. >> Did you notice the discus

Re: [HACKERS] Can pg_dump make use of CURRENT/SESSION_USER

2015-04-28 Thread Robert Haas
On Sat, Apr 25, 2015 at 8:05 AM, Fabrízio de Royes Mello wrote: >> >> > If we ever implement something like >> >> > >> >> > COMMENT ON CURRENT_DATABASE IS ... >> >> > >> >> > it will be useful, because you will be able to restore a dump into >> >> > another database and have the comment apply to t

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Amit Langote
On Tue, Apr 28, 2015 at 9:28 PM, David Fetter wrote: > On Tue, Apr 28, 2015 at 03:17:08PM +0900, Amit Langote wrote: >> >> An example, >> postgres=# alter foreign table fparent alter a type char; >> ALTER FOREIGN TABLE >> >> postgres=# select * from fparent; >> ERROR: attribute "a" of relation "f

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread David Fetter
On Tue, Apr 28, 2015 at 09:39:02PM +0900, Amit Langote wrote: > On Tue, Apr 28, 2015 at 9:28 PM, David Fetter wrote: > > On Tue, Apr 28, 2015 at 03:17:08PM +0900, Amit Langote wrote: > >> > >> An example, > >> postgres=# alter foreign table fparent alter a type char; > >> ALTER FOREIGN TABLE > >>

Re: [HACKERS] improving speed of make check-world

2015-04-28 Thread Michael Paquier
On Tue, Apr 28, 2015 at 1:46 AM, Jeff Janes wrote: > On Sat, Apr 25, 2015 at 7:23 AM, Michael Paquier > wrote: >> >> On Sat, Apr 25, 2015 at 7:59 AM, Peter Eisentraut wrote: >> > On 4/23/15 1:22 PM, Jeff Janes wrote: >> >> Something about this commit (dcae5faccab64776376d354d) broke "make >> >>

Re: [HACKERS] Shouldn't CREATE TABLE LIKE copy the relhasoids property?

2015-04-28 Thread Bruce Momjian
On Tue, Apr 28, 2015 at 12:24:50AM -0300, Alvaro Herrera wrote: > Bruce Momjian wrote: > > > Agreed. Here is an attached patch for 9.6 which works for multiple > > LIKE'ed tables with multiple inheritance and index creation. I figured > > out why Tom's OID primary key test was failing so I now p

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Petr Jelinek
On 28/04/15 03:51, Peter Geoghegan wrote: On Mon, Apr 27, 2015 at 4:21 PM, Peter Geoghegan wrote: * Don't change the ON CONFLICT spelling. * Don't change the names of the pseudo-alias EXCLUDED.* (or the alias TARGET.*). Those seem fine to me as well. * Change the syntax to put the WHERE claus

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Andres Freund
On 2015-04-28 16:36:28 +0200, Petr Jelinek wrote: > I am also very sure that every time I'll write this statement I will have to > look into manual for the names of TARGET and EXCLUDED because they don't > seem intuitive to me at all (especially the EXCLUDED). Same here. I don't understand why 'CO

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Stephen Frost
* Andres Freund (and...@anarazel.de) wrote: > On 2015-04-28 16:36:28 +0200, Petr Jelinek wrote: > > I am also very sure that every time I'll write this statement I will have to > > look into manual for the names of TARGET and EXCLUDED because they don't > > seem intuitive to me at all (especially t

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Andres Freund
On 2015-04-28 10:40:10 -0400, Stephen Frost wrote: > * Andres Freund (and...@anarazel.de) wrote: > > On 2015-04-28 16:36:28 +0200, Petr Jelinek wrote: > > > I am also very sure that every time I'll write this statement I will have > > > to > > > look into manual for the names of TARGET and EXCLUDE

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Stephen Frost
* Andres Freund (and...@anarazel.de) wrote: > On 2015-04-28 10:40:10 -0400, Stephen Frost wrote: > > * Andres Freund (and...@anarazel.de) wrote: > > > On 2015-04-28 16:36:28 +0200, Petr Jelinek wrote: > > > > I am also very sure that every time I'll write this statement I will > > > > have to > >

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Petr Jelinek
On 28/04/15 16:44, Andres Freund wrote: On 2015-04-28 10:40:10 -0400, Stephen Frost wrote: * Andres Freund (and...@anarazel.de) wrote: On 2015-04-28 16:36:28 +0200, Petr Jelinek wrote: I am also very sure that every time I'll write this statement I will have to look into manual for the names o

Re: [HACKERS] Proposal: knowing detail of config files via SQL

2015-04-28 Thread David Steele
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Looks good overall, but make installcheck-world does not pass

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Geoff Winkless
On 28 April 2015 at 15:46, Stephen Frost wrote: > +1, NEW/OLD seem pretty natural and I'm not worried about what they look > like in rules, and their usage in triggers matches up with what they'd > mean here, I'd think. > Since I've stuck my head above the parapet once I figured I'd give m y 2p'

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Geoff Winkless
On 28 April 2015 at 15:57, I wrote: > ​MySQL uses VALUES(columnname) to reference the intended INSERT value > (what you might term "NEW") and the target name to reference "OLD". I > understand that people might think the bracketed syntax isn't very pleasant > because that looks like a function, bu

Re: [HACKERS] Auditing extension for PostgreSQL (Take 2)

2015-04-28 Thread David Steele
On 4/28/15 2:14 AM, Sawada Masahiko wrote: > On Fri, Apr 24, 2015 at 3:23 AM, David Steele wrote: >> I've also added some checking to make sure that if anything looks funny >> on the stack an error will be generated. >> >> Thanks for the feedback! >> > > Thank you for updating the patch! > I ran

Re: [HACKERS] Proposal: knowing detail of config files via SQL

2015-04-28 Thread David Steele
On 4/27/15 10:37 PM, Sawada Masahiko wrote: > > Thank you for your reviewing. > Attached v8 patch is latest version. I posted a review through the CF app but it only went to the list instead of recipients of the latest message. install-checkworld is failing but the fix is pretty trivial. See: h

Re: [HACKERS] deparsing utility commands

2015-04-28 Thread Dimitri Fontaine
Hi, As a comment to the whole email below, I think the following approach is the best compromise we will find, allowing everybody to come up with their own format much as in the Logical Decoding plugins world. Of course, as in the Logical Decoding area, BDR and similar projects will implement the

Re: [HACKERS] Can pg_dump make use of CURRENT/SESSION_USER

2015-04-28 Thread Fabrízio de Royes Mello
On Tue, Apr 28, 2015 at 9:38 AM, Robert Haas wrote: > > On Sat, Apr 25, 2015 at 8:05 AM, Fabrízio de Royes Mello > wrote: > >> >> > If we ever implement something like > >> >> > > >> >> > COMMENT ON CURRENT_DATABASE IS ... > >> >> > > >> >> > it will be useful, because you will be able to restore

Re: [HACKERS] WIP: multivariate statistics / proof of concept

2015-04-28 Thread Jeff Janes
On Mon, Mar 30, 2015 at 5:26 PM, Tomas Vondra wrote: > Hello, > > attached is a new version of the patch series. Aside from fixing various > issues (crashes, memory leaks). The patches are rebased to current > master, and I also attach a few SQL scripts I used for testing (nothing > fancy, just s

Re: [HACKERS] Moving on to close the current CF 2015-02

2015-04-28 Thread Magnus Hagander
On Fri, Apr 17, 2015 at 4:57 PM, Magnus Hagander wrote: > On Fri, Apr 17, 2015 at 9:23 AM, Michael Paquier < > michael.paqu...@gmail.com> wrote: > >> On Fri, Apr 17, 2015 at 4:22 PM, Michael Paquier wrote: >> > @Magnus: having the possibility to mark a patch as "returned with >> > feedback" witho

Re: [HACKERS] WIP: multivariate statistics / proof of concept

2015-04-28 Thread Stephen Frost
* Jeff Janes (jeff.ja...@gmail.com) wrote: > On Mon, Mar 30, 2015 at 5:26 PM, Tomas Vondra > wrote: > > attached is a new version of the patch series. Aside from fixing various > > issues (crashes, memory leaks). The patches are rebased to current > > master, and I also attach a few SQL scripts I

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Peter Geoghegan
On Tue, Apr 28, 2015 at 7:38 AM, Andres Freund wrote: > On 2015-04-28 16:36:28 +0200, Petr Jelinek wrote: >> I am also very sure that every time I'll write this statement I will have to >> look into manual for the names of TARGET and EXCLUDED because they don't >> seem intuitive to me at all (espe

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Stephen Frost
* Peter Geoghegan (p...@heroku.com) wrote: > On Tue, Apr 28, 2015 at 7:38 AM, Andres Freund wrote: > > On 2015-04-28 16:36:28 +0200, Petr Jelinek wrote: > >> I am also very sure that every time I'll write this statement I will have > >> to > >> look into manual for the names of TARGET and EXCLUDE

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Peter Geoghegan
On Tue, Apr 28, 2015 at 9:42 AM, Stephen Frost wrote: > I agree with that, but how are NEW and OLD ambiguous? NEW is clearly > the tuple being added, while OLD is clearly the existing tuple. Yes, but EXCLUDED is neither the tuple being added, nor is it the new tuple. It's something else entirely

Re: [HACKERS] [PATCH] Add transforms feature

2015-04-28 Thread Jeff Janes
On Tue, Apr 7, 2015 at 7:55 PM, Peter Eisentraut wrote: > On 3/22/15 5:46 AM, Pavel Stehule wrote: > > Isn't better doesn't support "TRANSFORM ALL" clause? If somebody would > > to use transformations - then he have to explicitly enable it by > > "TRANSFORM FOR TYPE" ? It is safe and without poss

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Peter Geoghegan
On Tue, Apr 28, 2015 at 9:45 AM, Peter Geoghegan wrote: > Yes, but EXCLUDED is neither the tuple being added, nor is it the new > tuple. It's something else entirely. I mean, nor is it the existing tuple. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.or

Re: [HACKERS] [COMMITTERS] pgsql: Add transforms feature

2015-04-28 Thread Andrew Dunstan
Oops, thought I'd changed the address line. [switching to -hackers] On 04/28/2015 11:51 AM, Andrew Dunstan wrote: On 04/28/2015 09:04 AM, Michael Paquier wrote: On Tue, Apr 28, 2015 at 10:01 AM, Michael Paquier wrote: On Tue, Apr 28, 2015 at 9:55 AM, Andrew Dunstan wrote: w.r.t MSVC bui

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Stephen Frost
* Peter Geoghegan (p...@heroku.com) wrote: > On Tue, Apr 28, 2015 at 9:42 AM, Stephen Frost wrote: > > I agree with that, but how are NEW and OLD ambiguous? NEW is clearly > > the tuple being added, while OLD is clearly the existing tuple. > > Yes, but EXCLUDED is neither the tuple being added,

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Peter Geoghegan
On Tue, Apr 28, 2015 at 7:36 AM, Petr Jelinek wrote: > I am also very sure that every time I'll write this statement I will have to > look into manual for the names of TARGET and EXCLUDED because they don't > seem intuitive to me at all (especially the EXCLUDED). According to wordcount.org, the w

Re: [HACKERS] INSERT ... ON CONFLICT UPDATE/IGNORE 4.0, parser/executor stuff

2015-04-28 Thread Peter Geoghegan
On Tue, Apr 28, 2015 at 3:38 AM, Andres Freund wrote: > The more I look at approach taken in the executor, the less I like it. > I think the fundamental structural problem is that you've chosen to > represent the ON CONFLICT UPDATE part as fully separate plan tree node; > planned nearly like a nor

Re: [HACKERS] WIP: multivariate statistics / proof of concept

2015-04-28 Thread Jeff Janes
On Tue, Apr 28, 2015 at 9:13 AM, Stephen Frost wrote: > * Jeff Janes (jeff.ja...@gmail.com) wrote: > > On Mon, Mar 30, 2015 at 5:26 PM, Tomas Vondra < > tomas.von...@2ndquadrant.com> > > wrote: > > > attached is a new version of the patch series. Aside from fixing > various > > > issues (crashes,

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread David G. Johnston
On Tue, Apr 28, 2015 at 9:58 AM, Stephen Frost wrote: > * Peter Geoghegan (p...@heroku.com) wrote: > > On Tue, Apr 28, 2015 at 9:42 AM, Stephen Frost > wrote: > > > I agree with that, but how are NEW and OLD ambiguous? NEW is clearly > > > the tuple being added, while OLD is clearly the existin

[HACKERS] cache invalidation for PL/pgsql functions

2015-04-28 Thread Robert Haas
The following behavior surprised me, and a few other people at EnterpriseDB, and one of our customers: rhaas=# create table foo (a int); CREATE TABLE rhaas=# create or replace function test (x foo) returns int as $$begin return x.b; end$$ language plpgsql; CREATE FUNCTION rhaas=# alter table foo a

Re: [HACKERS] Allow SQL/plpgsql functions to accept record

2015-04-28 Thread Jim Nasby
On 4/27/15 10:06 PM, Andrew Dunstan wrote: My point remains that we really need methods of a) getting the field names from generic records and b) using text values to access fields of generic records, both as lvalues and rvalues. Without those this feature will be of comparatively little value, I

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-28 Thread Jim Nasby
On 4/28/15 1:16 AM, Pavel Stehule wrote: I think it can't be any clearer than the proposed "plpgsql.display_context_min_messages" client_min_context. It's doing the same thing as min_messages does, just for context instead of the message. Or does this affect client

Re: [HACKERS] Fwd: [GENERAL] 4B row limit for CLOB tables

2015-04-28 Thread Jim Nasby
On 4/28/15 5:41 AM, José Luis Tallón wrote: On 04/27/2015 08:49 AM, Jim Nasby wrote: On 4/25/15 1:19 PM, Bruce Momjian wrote: Note if you are storing a table with rows that exceed 2KB in size (aggregate size of each row) then the "Maximum number of rows in a table" may be limited to

Re: [HACKERS] Freeze avoidance of very large table.

2015-04-28 Thread Jim Nasby
On 4/28/15 7:11 AM, Robert Haas wrote: On Fri, Apr 24, 2015 at 4:09 PM, Jim Nasby wrote:>>> When I read that I think about something configurable at >>>relation-level.There are cases where you may want to have more >>>granularity of this information at block level by having the VM slots >>>to tr

[HACKERS] FIX : teach expression walker about RestrictInfo

2015-04-28 Thread Tomas Vondra
Hi there, the attached trivial patch adds handling of RestrictInfo nodes into expression_tree_walker(). This is needed for example when calling pull_varnos or (or other functions using the expression walker) in clausesel.c, for example. An example of a query causing errors with pull_varnos is

Re: [HACKERS] cache invalidation for PL/pgsql functions

2015-04-28 Thread Pavel Stehule
2015-04-28 19:43 GMT+02:00 Robert Haas : > The following behavior surprised me, and a few other people at > EnterpriseDB, and one of our customers: > > rhaas=# create table foo (a int); > CREATE TABLE > rhaas=# create or replace function test (x foo) returns int as $$begin > return x.b; end$$ lang

[HACKERS] pg_rewind test race condition..?

2015-04-28 Thread Stephen Frost
Heikki, Not sure if anyone else is seeing this, but I'm getting regression test failures when running the pg_rewind tests pretty consistently with 'make check'. Specifically with "basic remote", I'm getting: source and target cluster are on the same timeline Failure, exiting in regress_

Re: [HACKERS] Allow SQL/plpgsql functions to accept record

2015-04-28 Thread Merlin Moncure
On Tue, Apr 28, 2015 at 12:44 PM, Jim Nasby wrote: > On 4/27/15 10:06 PM, Andrew Dunstan wrote: >> >> My point remains that we really need methods of a) getting the field >> names from generic records and b) using text values to access fields of >> generic records, both as lvalues and rvalues. Wit

Re: [HACKERS] WIP: multivariate statistics / proof of concept

2015-04-28 Thread Tomas Vondra
Hi, On 04/28/15 19:36, Jeff Janes wrote: > ... Thanks. I think I tried that, but was still having trouble. But it turns out that the trouble was for an unrelated reason, and I got it to compile now. Yeah, a new column was added to pg_proc the day after I submitted the pacth. Will address tha

Re: [HACKERS] Freeze avoidance of very large table.

2015-04-28 Thread Robert Haas
On Tue, Apr 28, 2015 at 1:53 PM, Jim Nasby wrote: > Because in those cases it would be trivial to drop XMIN out of the tuple > headers. For a warehouse with narrow rows that could be a significant win. > Moreso, we could also move XMAX to the page level if we accept that if we > need to invalidate

Re: [HACKERS] cache invalidation for PL/pgsql functions

2015-04-28 Thread Jim Nasby
On 4/28/15 12:58 PM, Pavel Stehule wrote: I hate to use the term "bug" for what somebody's probably going to tell me is acceptable behavior, but that seems like a bug. I guess the root of the problem is that PL/plgsql's cache invalidation logic only considers the pg_proc row's TI

Re: [HACKERS] Allow SQL/plpgsql functions to accept record

2015-04-28 Thread Andrew Dunstan
On 04/28/2015 01:44 PM, Jim Nasby wrote: On 4/27/15 10:06 PM, Andrew Dunstan wrote: My point remains that we really need methods of a) getting the field names from generic records and b) using text values to access fields of generic records, both as lvalues and rvalues. Without those this featu

Re: [HACKERS] Feedback on getting rid of VACUUM FULL

2015-04-28 Thread Robert Haas
On Fri, Apr 24, 2015 at 3:04 PM, Alvaro Herrera wrote: > Heikki Linnakangas wrote: >> Hmm, AFAICT pg_reorg is much more complex, writing stuff to a temp table >> and swapping relfilenodes afterwards. More like the VACUUM REWRITE >> that's been discussed. >> >> For the kicks, I looked at what it wo

Re: [HACKERS] parallel mode and parallel contexts

2015-04-28 Thread Robert Haas
On Sun, Apr 26, 2015 at 2:03 PM, Euler Taveira wrote: > On 19-03-2015 15:13, Robert Haas wrote: >> On Wed, Mar 18, 2015 at 5:36 PM, Andres Freund >> wrote: >>> Reading the README first, the rest later. So you can comment on my >>> comments, while I actually look at the code. Parallelism, yay! >>

Re: [HACKERS] parallel mode and parallel contexts

2015-04-28 Thread Robert Haas
On Sun, Apr 26, 2015 at 9:57 PM, Amit Langote wrote: > On 2015-04-22 AM 04:14, Robert Haas wrote: >> We should check IsParallelWorker() for operations that are allowed in >> the master during parallel mode, but not allowed in the workers - e.g. >> the master can scan its own temporary relations, b

Re: [HACKERS] Feedback on getting rid of VACUUM FULL

2015-04-28 Thread Alvaro Herrera
Robert Haas wrote: > On Fri, Apr 24, 2015 at 3:04 PM, Alvaro Herrera > wrote: > > I think what we need here is something that does heap_update to tuples > > at the end of the table, moving them to earlier pages; then wait for old > > snapshots to die (the infrastructure for which we have now, tha

[HACKERS] COPY and file_fdw with fixed column widths

2015-04-28 Thread Bruce Momjian
I know COPY doesn't support importing files with fixed column widths, i.e. we can't say field1 is the first 30 characters, and field2 is the rest of the line. We need a unique delimiter at column 31. (Commercial Ingres does support this ability.) I know we tell most people to use sed, Perl, or a

Re: [HACKERS] ATSimpleRecursion() and inheritance foreign parents

2015-04-28 Thread Tom Lane
Etsuro Fujita writes: > On 2015/04/28 15:17, Amit Langote wrote: >> The code at the beginning of ATSimpleRecursion() looks like - >> if (recurse && rel->rd_rel->relkind == RELKIND_RELATION) >> Not sure if it's great idea, but now that foreign tables can also have >> children, should above be chang

Re: [HACKERS] INSERT ... ON CONFLICT syntax issues

2015-04-28 Thread Peter Geoghegan
On Tue, Apr 28, 2015 at 10:36 AM, David G. Johnston wrote: > This example exemplifies the poorness of the proposed wording, IMO: > > > [...] > SET dname = EXCLUDED.dname || ' (formerly ' || TARGET.dname || ')' > > NEW.dname || '(formerly ' || OLD.dname || ')' reads perfectly well. > > Yes, this is

Re: [HACKERS] cache invalidation for PL/pgsql functions

2015-04-28 Thread Merlin Moncure
On Tue, Apr 28, 2015 at 12:43 PM, Robert Haas wrote: > I hate to use the term "bug" for what somebody's probably going to > tell me is acceptable behavior, but that seems like a bug. I guess > the root of the problem is that PL/plgsql's cache invalidation logic > only considers the pg_proc row's

Re: [HACKERS] COPY and file_fdw with fixed column widths

2015-04-28 Thread Tom Lane
Bruce Momjian writes: > I know COPY doesn't support importing files with fixed column widths, > i.e. we can't say field1 is the first 30 characters, and field2 is the > rest of the line. We need a unique delimiter at column 31. (Commercial > Ingres does support this ability.) > I know we tell m

Re: [HACKERS] COPY and file_fdw with fixed column widths

2015-04-28 Thread Bruce Momjian
On Tue, Apr 28, 2015 at 12:46:22PM -0700, Tom Lane wrote: > Bruce Momjian writes: > > I know COPY doesn't support importing files with fixed column widths, > > i.e. we can't say field1 is the first 30 characters, and field2 is the > > rest of the line. We need a unique delimiter at column 31. (C

Re: [HACKERS] FIX : teach expression walker about RestrictInfo

2015-04-28 Thread Tom Lane
Tomas Vondra writes: > the attached trivial patch adds handling of RestrictInfo nodes into > expression_tree_walker(). RestrictInfo is not a general expression node and support for it has been deliberately omitted from expression_tree_walker(). So I think what you are proposing is a bad idea an

Re: [HACKERS] cache invalidation for PL/pgsql functions

2015-04-28 Thread Tom Lane
Robert Haas writes: > rhaas=# create table foo (a int); > CREATE TABLE > rhaas=# create or replace function test (x foo) returns int as $$begin > return x.b; end$$ language plpgsql; > CREATE FUNCTION > rhaas=# alter table foo add column b int; > ALTER TABLE > rhaas=# select test(null::foo); > ERRO

Re: [HACKERS] improving speed of make check-world

2015-04-28 Thread Peter Eisentraut
On 4/28/15 9:09 AM, Michael Paquier wrote: >> I guess by redirecting it into the log file you indicated, but is that a >> > good idea to redirect stderr? > I am sure that Peter did that on purpose, both approaches having > advantages and disadvantages. Personally I don't mind looking at the > insta

Re: [HACKERS] [COMMITTERS] pgsql: Add transforms feature

2015-04-28 Thread Andrew Dunstan
On 04/28/2015 12:03 PM, Andrew Dunstan wrote: [switching to -hackers] On 04/28/2015 11:51 AM, Andrew Dunstan wrote: On 04/28/2015 09:04 AM, Michael Paquier wrote: On Tue, Apr 28, 2015 at 10:01 AM, Michael Paquier wrote: On Tue, Apr 28, 2015 at 9:55 AM, Andrew Dunstan wrote: w.r.t MSVC bui

Re: [HACKERS] [COMMITTERS] pgsql: Add transforms feature

2015-04-28 Thread Peter Eisentraut
On 4/28/15 4:10 PM, Andrew Dunstan wrote: >> Do we actually have a Windows machine building with Python3? > > > The answer seems to be "probably not". When I tried enabling this with > bowerbird I got a ton of errors like these: > >plpy_cursorobject.obj : error LNK2001: unresolved external s

[HACKERS] shared_libperl, shared_libpython

2015-04-28 Thread Peter Eisentraut
On 4/28/15 12:05 AM, Tom Lane wrote: > Yeah. Even more specifically, olinguito does have --with-python in its > configure flags, but then the plpython Makefile skips the build because > libpython isn't available as a shared library. But the contrib test is > (I assume, haven't looked) conditional

Re: [HACKERS] COPY and file_fdw with fixed column widths

2015-04-28 Thread Andrew Dunstan
On 04/28/2015 03:50 PM, Bruce Momjian wrote: On Tue, Apr 28, 2015 at 12:46:22PM -0700, Tom Lane wrote: Bruce Momjian writes: I know COPY doesn't support importing files with fixed column widths, i.e. we can't say field1 is the first 30 characters, and field2 is the rest of the line. We need

Re: [HACKERS] tablespaces inside $PGDATA considered harmful

2015-04-28 Thread Bruce Momjian
On Fri, Apr 24, 2015 at 01:05:03PM -0400, Bruce Momjian wrote: > This way, both pg_dump and pg_upgrade will issue warnings, though, of > course, those warnings can be ignored. I am hopeful these two warnings > will be sufficient and we will not need make these errors, with the > possible inconveni

Re: [HACKERS] FIX : teach expression walker about RestrictInfo

2015-04-28 Thread Tomas Vondra
Hi, On 04/28/15 21:50, Tom Lane wrote: Tomas Vondra writes: the attached trivial patch adds handling of RestrictInfo nodes into expression_tree_walker(). RestrictInfo is not a general expression node and support for it has been deliberately omitted from expression_tree_walker(). So I think

Re: [HACKERS] shared_libperl, shared_libpython

2015-04-28 Thread Andrew Dunstan
On 04/28/2015 04:31 PM, Peter Eisentraut wrote: On 4/28/15 12:05 AM, Tom Lane wrote: Yeah. Even more specifically, olinguito does have --with-python in its configure flags, but then the plpython Makefile skips the build because libpython isn't available as a shared library. But the contrib te

Re: [HACKERS] Can pg_dump make use of CURRENT/SESSION_USER

2015-04-28 Thread Fabrízio de Royes Mello
On Tue, Apr 28, 2015 at 1:07 PM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > > > On Tue, Apr 28, 2015 at 9:38 AM, Robert Haas wrote: > > > > On Sat, Apr 25, 2015 at 8:05 AM, Fabrízio de Royes Mello > > wrote: > > >> >> > If we ever implement something like > > >> >> > > > >> >> >

Re: [HACKERS] pg_basebackup, tablespace mapping and path canonicalization

2015-04-28 Thread Bruce Momjian
On Fri, Feb 6, 2015 at 08:25:42AM -0500, Robert Haas wrote: > On Thu, Feb 5, 2015 at 10:21 PM, Ian Barwick wrote: > > I stumbled on what appears to be inconsistent handling of double slashes > > in tablespace paths when using pg_basebackup with the > > -T/--tablespace-mapping > > option: > > > >

Re: [HACKERS] Allow SQL/plpgsql functions to accept record

2015-04-28 Thread Jim Nasby
On 4/28/15 1:31 PM, Andrew Dunstan wrote: On 04/28/2015 01:44 PM, Jim Nasby wrote: On 4/27/15 10:06 PM, Andrew Dunstan wrote: My point remains that we really need methods of a) getting the field names from generic records and b) using text values to access fields of generic records, both as lv

Re: [HACKERS] pg_basebackup, tablespace mapping and path canonicalization

2015-04-28 Thread Ian Barwick
On 29/04/15 09:12, Bruce Momjian wrote: > On Fri, Feb 6, 2015 at 08:25:42AM -0500, Robert Haas wrote: >> On Thu, Feb 5, 2015 at 10:21 PM, Ian Barwick wrote: >>> I stumbled on what appears to be inconsistent handling of double slashes >>> in tablespace paths when using pg_basebackup with the >>

Re: [HACKERS] pg_rewind test race condition..?

2015-04-28 Thread Heikki Linnakangas
On 04/28/2015 11:02 AM, Stephen Frost wrote: Heikki, Not sure if anyone else is seeing this, but I'm getting regression test failures when running the pg_rewind tests pretty consistently with 'make check'. Specifically with "basic remote", I'm getting: source and target cluster are on

Re: [HACKERS] Feedback on getting rid of VACUUM FULL

2015-04-28 Thread Jim Nasby
On 4/28/15 1:32 PM, Robert Haas wrote: More than five years have passed since Heikki posted this, and we still >haven't found a solution to the problem -- which neverthless keeps >biting people to the point that multiple "user-space" implementations of >similar techniques are out there. Yeah. T

Re: [HACKERS] why does enum_endpoint call GetTransactionSnapshot()?

2015-04-28 Thread Bruce Momjian
On Sat, Feb 14, 2015 at 05:29:43PM -0500, Robert Haas wrote: > On Sat, Feb 14, 2015 at 5:12 PM, Tom Lane wrote: > > Robert Haas writes: > >> I think this is probably a holdover from before the death of > >> SnapshotNow, and that we should just pass NULL to > >> systable_beginscan_ordered() here,

Re: [HACKERS] Temporal extensions

2015-04-28 Thread Dave Jones
Hi Jim, On 28/04/15 03:49, Jim Nasby wrote: > On 4/27/15 6:08 PM, Dave Jones wrote: >>> (Though, I dislike using timestamps to do change/history tracking, but >>> >that's just me...) >> I've been playing around with history tracking (in the context of BI, >> typically with batch loaded reporting d

Re: [HACKERS] Replication identifiers, take 4

2015-04-28 Thread Peter Eisentraut
On 4/24/15 4:29 PM, Andres Freund wrote: >> Shouldn't this be backed up by pg_dump(all?)? > > Given it deals with LSNs and is, quite fundamentally due to concurrency, non > transactional, I doubt it's worth it. The other side's slots also aren't > going to be backed up as pg dump obviously can't

Re: [HACKERS] shared_libperl, shared_libpython

2015-04-28 Thread Tom Lane
Peter Eisentraut writes: > On 4/28/15 12:05 AM, Tom Lane wrote: >> Yeah. Even more specifically, olinguito does have --with-python in its >> configure flags, but then the plpython Makefile skips the build because >> libpython isn't available as a shared library. But the contrib test is >> (I ass

Re: [HACKERS] FIX : teach expression walker about RestrictInfo

2015-04-28 Thread Tom Lane
Tomas Vondra writes: > On 04/28/15 21:50, Tom Lane wrote: >> RestrictInfo is not a general expression node and support for it has >> been deliberately omitted from expression_tree_walker(). So I think >> what you are proposing is a bad idea and probably a band-aid for some >> other bad idea. > T

Re: [HACKERS] improving speed of make check-world

2015-04-28 Thread Tom Lane
Michael Paquier writes: > On Tue, Apr 28, 2015 at 1:46 AM, Jeff Janes wrote: >> This change fixed the problem for me. >> It also made this age-old compiler warning go away: >> >> In file included from gram.y:14515: >> scan.c: In function 'yy_try_NUL_trans': >> scan.c:10307: warning: unused varia

Re: [HACKERS] [COMMITTERS] pgsql: Add transforms feature

2015-04-28 Thread Michael Paquier
On Wed, Apr 29, 2015 at 5:15 AM, Peter Eisentraut wrote: > On 4/28/15 4:10 PM, Andrew Dunstan wrote: >>> Do we actually have a Windows machine building with Python3? >> >> >> The answer seems to be "probably not". When I tried enabling this with >> bowerbird I got a ton of errors like these: >> >>

Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan API)

2015-04-28 Thread Ashutosh Bapat
On Fri, Apr 24, 2015 at 3:08 PM, Shigeru HANADA wrote: > Hi Ashutosh, > > Thanks for the review. > > 2015/04/22 19:28、Ashutosh Bapat のメール: > > Tests > > --- > > 1.The postgres_fdw test is re/setting enable_mergejoin at various > places. The goal of these tests seems to be to test the sanity