Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2016-03-19 Thread Jim Nasby
On 3/15/16 7:17 PM, Tom Lane wrote: In short, I think we should reject this implementation and instead try to implement the type operators we want in the core grammar's Typename production, from which plpgsql will pick it up automatically. +1. Something else that's been discussed is allowing [

Re: [HACKERS] Show dropped users' backends in pg_stat_activity

2016-03-19 Thread Oskari Saarenmaa
16.03.2016, 17:48, Tom Lane kirjoitti: Robert Haas writes: Gee, I would have expected the DROP to be blocked until the user disconnected, like we do for DROP DATABASE. Making that race-condition-free would require some notion of a lock on roles, I think. Seems pretty messy compared to the am

Re: [HACKERS] Re: Add generate_series(date,date) and generate_series(date,date,integer)

2016-03-19 Thread Tom Lane
David Steele writes: > On 3/17/16 11:55 AM, David G. Johnston wrote: >> With the first argument casted to date it doesn't matter whether you >> cast the second argument as the pseudo-type anyelement will take its >> value from the first argument and force the second to date. > Ah, I see. FWIW, t

Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2016-03-19 Thread Amit Kapila
On Wed, Mar 16, 2016 at 11:57 PM, Jesper Pedersen < jesper.peder...@redhat.com> wrote: > > On 03/15/2016 01:17 AM, Amit Kapila wrote: >> >> I have updated the comments and changed the name of one of a variable from >> "all_trans_same_page" to "all_xact_same_page" as pointed out offlist by >> Alvaro

Re: [HACKERS] WIP: Upper planner pathification

2016-03-19 Thread Kouhei Kaigai
> > Robert Haas writes: > > > On Mon, Mar 14, 2016 at 9:21 PM, Kouhei Kaigai > > > wrote: > > >> So, even though we don't need to define multiple hook declarations, > > >> I think the hook invocation is needed just after create__paths() > > >> for each. It will need to inform extension the c

Re: [HACKERS] [BUGS] pgbench -C -M prepared gives an error

2016-03-19 Thread Tatsuo Ishii
Sounds like a bug. We should either fix pgbench so that -M and -C can be used together (I don't see any technical reason why we can't do this) or modify pgbench to not allow using -M and -C (less desirable). Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_e

[HACKERS] Minor typos in optimizer/README

2016-03-19 Thread Jim Nasby
Studying the partification commit, I noticed a few typos in $SUBJECT. Patch attached. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com diff --git a/src/backend/optimizer/

Re: [HACKERS] [GENERAL] Request - repeat value of \pset title during \watch interations

2016-03-19 Thread David Steele
On 3/17/16 5:07 PM, David G. Johnston wrote: > Figured out it had to be added to 2016-09...done Hmm ... this patch is currently marked "needs review" in CF 2016-03. Am I missing something, should this have been closed? -- -David da...@pgmasters.net -- Sent via pgsql-hackers mailing list (pg

Re: [HACKERS] Performance degradation in commit ac1d794

2016-03-19 Thread Amit Kapila
On Thu, Mar 17, 2016 at 7:34 AM, Andres Freund wrote: > Hi, > > * I can do a blind rewrite of the windows implementation, but I'm > obviously not going to get that entirely right. So I need some help > from a windows person to test this. > I can help you verifying the windows implementation.

Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2016-03-19 Thread Jim Nasby
On 3/3/16 4:51 AM, Pavel Stehule wrote: CREATE TABLE a(a int); CREATE TABLE b(a a.a%TYPE) And the people expecting the living relation between table a and table b. So when I do ALTER a.a, then b.a should be changed. What if I drop a.a or drop a? So this is reason, why I don't would this feature

Re: [HACKERS] WIP: Upper planner pathification

2016-03-19 Thread Kouhei Kaigai
> Robert Haas writes: > > On Mon, Mar 14, 2016 at 9:21 PM, Kouhei Kaigai wrote: > >> So, even though we don't need to define multiple hook declarations, > >> I think the hook invocation is needed just after create__paths() > >> for each. It will need to inform extension the context of hook >

[HACKERS] Re: [PATH] Jsonb, insert a new value into an array at arbitrary position

2016-03-19 Thread Petr Jelinek
I still don't like that this works on path leading to an object given that we can't fulfill the promise of inserting to an arbitrary position there. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hac

Re: [HACKERS] Parallel Aggregate

2016-03-19 Thread James Sewell
Hi again, This is probably me missing something, but is there a reason parallel aggregate doesn't seem to ever create append nodes containing Index scans? SET random_page_cost TO 0.2; SET max_parallel_degree TO 8; postgres=# explain SELECT sum(count_i) FROM base GROUP BY view_time_day;

Re: [HACKERS] [PATCH] Integer overflow in timestamp[tz]_part() and date/time boundaries check

2016-03-19 Thread Vitaly Burovoy
On 3/16/16, Tom Lane wrote: > So I fixed that up and committed it, with a very short set of new > regression test cases. I seriously doubt that the other ones add > enough value to be worth trying to make them work in both float- and > int-timestamp cases; though if you want to submit a new patch

Re: [HACKERS] Declarative partitioning

2016-03-19 Thread Alexander Korotkov
Hi, Amit! I tried to apply your patch. It still applies, but has some duplicate oids. After fixing duplicate oids, I've noticed following warning during compilation by clang-700.1.81. scan.c:10308:23: warning: unused variable 'yyg' [-Wunused-variable] struct yyguts_t * yyg = (struct yyguts_

Re: [HACKERS] Proposal: BSD Authentication support

2016-03-19 Thread Thomas Munro
On Fri, Mar 18, 2016 at 12:49 PM, Marisa Emerson wrote: > On 18/03/16 03:57, Thomas Munro wrote: >> >> You used one name in the docs and another in the code: >> >> +BSD Authentication on PostgreSQL uses the >> auth-postgres >> +login type and authenticates with the postgres >> login >> >>

Re: [HACKERS] Re: [PATCH] Integer overflow in timestamp[tz]_part() and date/time boundaries check

2016-03-19 Thread Tom Lane
Anastasia Lubennikova writes: > There is an issue, mentioned in the thread above: >> postgres=# select >> postgres-# to_char(date_trunc('week', '4713-01-01 BC'::date),'day') >> postgres-# ,to_char(date_trunc('week', '4714-12-29 BC'::date),'day') >> postgres-# ,to_char(date_trunc('wee

Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2016-03-19 Thread Pavel Stehule
2016-03-17 0:39 GMT+01:00 Tom Lane : > Jim Nasby writes: > > On 3/3/16 4:51 AM, Pavel Stehule wrote: > >> CREATE TABLE a(a int); > >> CREATE TABLE b(a a.a%TYPE) > >> > >> And the people expecting the living relation between table a and table > >> b. So when I do ALTER a.a, then b.a should be chan

Re: [HACKERS] Request - repeat value of \pset title during \watch interations

2016-03-19 Thread David G. Johnston
On Thursday, March 17, 2016, Michael Paquier wrote: > On Fri, Mar 18, 2016 at 8:16 AM, Tom Lane > wrote: > > David Steele > writes: > >> On 3/17/16 7:00 PM, Tom Lane wrote: > >>> The message I saw was post-1-March. If it was in fact submitted in > >>> time for 2016-03, then we owe it a review.

Re: [HACKERS] Improve error handling in pltcl

2016-03-19 Thread Pavel Stehule
Hi 2016-03-13 20:24 GMT+01:00 Jim Nasby : > On 3/3/16 8:51 AM, Pavel Stehule wrote: > >> Hi >> >> I am testing behave, and some results looks strange >> > > Thanks for the review! > > postgres=# \sf foo >> CREATE OR REPLACE FUNCTION public.foo() >> RETURNS void >> LANGUAGE plpgsql >> AS $func

Re: [HACKERS] [WIP] speeding up GIN build with parallel workers

2016-03-19 Thread Amit Kapila
On Thu, Mar 17, 2016 at 2:56 PM, Constantin S. Pan wrote: > > On Thu, 17 Mar 2016 13:21:32 +0530 > Amit Kapila wrote: > > > On Wed, Mar 16, 2016 at 7:50 PM, Constantin S. Pan > > wrote: > > > > > > On Wed, 16 Mar 2016 18:08:38 +0530 > > > Amit Kapila wrote: > > > > > > > > > > > Why backend jus

Re: [HACKERS] Re: Add generate_series(date,date) and generate_series(date,date,integer)

2016-03-19 Thread David Steele
On 3/17/16 1:17 PM, Robert Haas wrote: > On Thu, Mar 17, 2016 at 12:59 PM, Tom Lane wrote: >> One idea that might be worth considering is to define the function >> as generate_series(date,date,interval) returns timestamp (without >> time zone). The point here would be only to move the behavior fo

Re: [HACKERS] [GENERAL] Request - repeat value of \pset title during \watch interations

2016-03-19 Thread David G. Johnston
Figured out it had to be added to 2016-09...done On Wed, Mar 9, 2016 at 11:40 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > Adding -hackers for consideration in the Commitfest. > > Thanks! > > David J. > > >>>Original request by me > > > http://www.postgresql.org/message-id/CAKFQuw

Re: [HACKERS] WIP: Upper planner pathification

2016-03-19 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 14, 2016 at 9:21 PM, Kouhei Kaigai wrote: >> So, even though we don't need to define multiple hook declarations, >> I think the hook invocation is needed just after create__paths() >> for each. It will need to inform extension the context of hook >> invocatio

Re: [HACKERS] Performance degradation in commit ac1d794

2016-03-19 Thread Andres Freund
On March 18, 2016 11:52:08 PM PDT, Amit Kapila wrote: >On Sat, Mar 19, 2016 at 12:14 PM, Andres Freund >wrote: >> >> >> >> On March 18, 2016 11:32:53 PM PDT, Amit Kapila > >wrote: >> >On Sat, Mar 19, 2016 at 12:00 AM, Andres Freund >> >wrote: >> >> >> >> On 2016-03-18 20:14:07 +0530, Amit Kapi

Re: [HACKERS] incorrect docs for pgbench / skipped transactions

2016-03-19 Thread Fabien COELHO
Hello Tomas, while learning about format of the transaction log produced by pgbench, I've noticed this sentence in the section describing format of the per-transaction log: The last field skipped_transactions reports the number of transactions skipped because they were too far behind sch

Re: [HACKERS] Odd system-column handling in postgres_fdw join pushdown patch

2016-03-19 Thread Robert Haas
On Thu, Mar 17, 2016 at 7:00 AM, Etsuro Fujita wrote: > BUT: we don't make any effort to ensure that local and remote values > match, so system columns other than ctid and oid should not be retrieved > from the remote server. I agree. > So, I'd like to propose: (1) when tableoids are > requested

Re: [HACKERS] Re: Add generate_series(date,date) and generate_series(date,date,integer)

2016-03-19 Thread Corey Huinker
On Thu, Mar 17, 2016 at 11:30 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > ​I'd call it "generate_dates(...)" and be done with it. > Sold. Hope to have a revised patch for you today or tomorrow.

Re: [HACKERS] btree_gin and btree_gist for enums

2016-03-19 Thread Robert Haas
On Thu, Mar 17, 2016 at 11:21 AM, Andrew Dunstan wrote: > On 03/17/2016 06:44 AM, Andrew Dunstan wrote: >> >> Here is a patch to add enum support to btree_gin and btree_gist. I didn't >> include distance operations, as I didn't think it terribly important, and >> there isn't a simple way to comput

Re: [HACKERS] Password identifiers, protocol aging and SCRAM protocol

2016-03-19 Thread Robert Haas
On Fri, Mar 18, 2016 at 2:12 PM, Stephen Frost wrote: > I'm not sure that I agree with the above. This patch has been through > the ringer multiple times regarding the user-facing bits and, by and > large, the results appear reasonable. Further, getting a better auth > method into PG is somethin

Re: [HACKERS] async replication code

2016-03-19 Thread Stas Kelvich
> On 16 Mar 2016, at 15:52, otheus uibk wrote: > > Greetings, Hi > > I am new here. Apologetic question: how can i search the archives of this > mailing list? Is there some set of magic words to put in Google? Must I wade > through 20 pages of hits? Should I download all the archives and g

Re: [HACKERS] Re: Add generate_series(date,date) and generate_series(date,date,integer)

2016-03-19 Thread Corey Huinker
On Thu, Mar 17, 2016 at 10:00 AM, David Steele wrote: > On 3/17/16 4:49 AM, Dean Rasheed wrote: > > > On 16 March 2016 at 23:32, David Steele wrote: > > > >> > >> I think in this case it comes down to a committer's judgement so I have > >> marked this "ready for committer" and passed the buck on

Re: [HACKERS] WIP: Upper planner pathification

2016-03-19 Thread Robert Haas
On Thu, Mar 17, 2016 at 2:31 PM, Tom Lane wrote: > Well, I'm prepared to yield to the extent of repeating the hook call > before each phase with an UpperRelationKind parameter to tell which phase > we're about to do. The main concern here is to avoid redundant > computation, but the hook can chec

Re: [HACKERS] [PATCH] Supporting +-Infinity values by to_timestamp(float8)

2016-03-19 Thread Vitaly Burovoy
On 2016-03-15, David Steele wrote: > On 3/4/16 2:56 PM, Vitaly Burovoy wrote: >> On 3/4/16, Anastasia Lubennikova wrote: >> >>> I think that you should update documentation. At least description of >>> epoch on this page: >>> http://www.postgresql.org/docs/devel/static/functions-datetime.html >>

Re: [HACKERS] Choosing parallel_degree

2016-03-19 Thread Robert Haas
On Tue, Mar 15, 2016 at 8:26 PM, Julien Rouhaud wrote: > On 15/03/2016 21:12, Robert Haas wrote: > > On Mon, Mar 14, 2016 at 9:25 PM, David Rowley > > wrote: > >> Over in [1] James mentioned about wanting more to be able to have more > >> influence over the partial path's parallel_degree decisio

Re: Pushdown target list below gather node (WAS Re: [HACKERS] WIP: Upper planner pathification)

2016-03-19 Thread Amit Kapila
On Thu, Mar 17, 2016 at 7:10 PM, Tom Lane wrote: > > Amit Kapila writes: > > While reading above code changes, it looks like it is assuming that subpath > > and subplan will always be same (as it is verifying projection capability > > of subpath and attaching the tlist to subplan), but I think it

Re: [HACKERS] Performance degradation in commit ac1d794

2016-03-19 Thread Robert Haas
On Wed, Mar 16, 2016 at 2:52 PM, Andres Freund wrote: > How about the following sketch of an API > > typedef struct LatchEvent > { > uint32 events; /* interesting events */ > uint32 revents; /* returned events */ > int fd; /* fd associated with event */ > } LatchEvent; > >

Re: [HACKERS] pg_hba_lookup function to get all matching pg_hba.conf entries

2016-03-19 Thread Haribabu Kommi
On Wed, Mar 16, 2016 at 9:49 PM, Shulgin, Oleksandr wrote: > On Tue, Mar 15, 2016 at 7:23 PM, David Steele wrote: >> >> On 3/3/16 12:16 AM, Haribabu Kommi wrote: >> > On Fri, Feb 5, 2016 at 2:29 PM, Haribabu Kommi >> > wrote: >> >> >> >> This patch needs to be applied on top discard_hba_and_iden

Re: [HACKERS] Choosing parallel_degree

2016-03-19 Thread James Sewell
Hey, I think are definitely use cases for using parallel agg on a small table when the time for each agg operation is very high. PostGIS can be used to create many examples of low row count and table size but high CPU operations. This does bring up an interesting point I don't quite understand t

Re: [HACKERS] Proposal: Generic WAL logical messages

2016-03-19 Thread Tomas Vondra
Hi, a few comments about the last version of the patch: 1) LogicalDecodeMessageCB Do we actually need the 'transactional' parameter here? I mean, having the 'txn' should be enough, as transactional = (txt != NULL) Of course, having a simple flag is more convenient. 2) pg_logical_emit

<    1   2   3   4