Re: [HACKERS] COPY as a set returning function

2016-10-16 Thread Craig Ringer
On 15 Oct. 2016 04:56, "Corey Huinker" wrote: > I would like to make COPY itself a SRF. That's a bit beyond my capabilities, so if that is the route we want to go, I will need help. > > The syntax would probably look like this (new bits in bold): > >> WITH my_copy AS (

Re: [HACKERS] pg_stat_statements and non default search_path

2016-10-16 Thread Lukas Fittl
On Sat, Oct 15, 2016 at 11:29 PM, Julien Rouhaud wrote: > > > BTW, after thinking about it some more, I don't see how storing the > > search_path would help at all... it's not like you can do anything with > > it unless you have a huge chunk of the parser available. > >

Re: [HACKERS] pg_stat_statements and non default search_path

2016-10-16 Thread Craig Ringer
On 16 Oct. 2016 14:31, "Julien Rouhaud" wrote: > > On 16/10/2016 02:38, Jim Nasby wrote: > > On 10/10/16 12:58 AM, Julien Rouhaud wrote: > >> Unless you mean deparsing the Query instead of using raw source text? I > >> think that would solve this issue (and also the

Re: [HACKERS] pg_stat_statements and non default search_path

2016-10-16 Thread Julien Rouhaud
On 16/10/2016 11:21, Craig Ringer wrote: > On 16 Oct. 2016 14:31, Julien Rouhaud wrote: >> >> On 16/10/2016 02:38, Jim Nasby wrote: >> > On 10/10/16 12:58 AM, Julien Rouhaud wrote: >> >> Unless you mean deparsing the Query instead of using raw source > text? I >> >> think that would solve this

Re: [HACKERS] pg_stat_statements and non default search_path

2016-10-16 Thread Julien Rouhaud
On 16/10/2016 02:38, Jim Nasby wrote: > On 10/10/16 12:58 AM, Julien Rouhaud wrote: >> Unless you mean deparsing the Query instead of using raw source text? I >> think that would solve this issue (and also the other issue when >> multiple queries are submitted at once, you get the normalized

Re: [HACKERS] [PATCH] pgpassfile connection option

2016-10-16 Thread Fabien COELHO
My 0.02€: Patch applies cleanly, make check ok... however AFAICS it only means that it compiles but it is not tested in anyway... This is is annoying. Well I'm not sure whether other options are tested either, but they should. ISTM that this feature is already available through the

Re: [HACKERS] pg_stat_statements and non default search_path

2016-10-16 Thread Julien Rouhaud
On 16/10/2016 10:47, Lukas Fittl wrote: > Can somebody chime in if it would be feasible to store this in the > out-of-band query text file, and whether a patch for this would be > considered acceptable? FWIW I already have a quick and dirty patch for this, I don't think there's any major

Re: [HACKERS] bit|varbit #, xor operator

2016-10-16 Thread Tom Lane
Jim Nasby writes: > Personally I think it was a mistake to use # for intersection. Range > doesn't do that (using * instead), and AFAICT PostGIS doesn't either > (preferring &). So I propose renaming those operators, as well as the > XOR ones. I think ^^ is pretty

Re: [HACKERS] VACUUM's ancillary tasks

2016-10-16 Thread Jeff Janes
On Fri, Oct 7, 2016 at 6:14 AM, Robert Haas wrote: > On Thu, Oct 6, 2016 at 8:40 PM, Jeff Janes wrote: > > In commit 37484ad2aacef5ec7, you changed the way that frozen tuples were > > represented, so that we could make freezing more aggressive

[HACKERS] Question on "record type has not been registered"

2016-10-16 Thread Jim Nasby
I'm working on a function(attached) that returns a bitmask of NULL fields in a record. It works fine if I feed it a row directly, but fails in this case: select record_nulls(r), expected, CASE WHEN record_nulls(r) <> expected THEN 'BAD' END AS bad, r from

[HACKERS] bit|varbit #, xor operator

2016-10-16 Thread Jim Nasby
Related to [1], I want to add an operator that returns the count of set (or unset) bits in a bit|varbit input. Given the number of times people ask "how can I get a count of NULL fields" and similar, I expect this to become quite popular. The obvious choice would be to use #, but I was rather

[HACKERS] postgres_fdw super user checks

2016-10-16 Thread Jeff Janes
postgres_fdw has some checks to enforce that non-superusers must connect to the foreign server with a password-based method. The reason for this is to prevent the authentication to the foreign server from happening on the basis of the OS user who is running the non-foreign server. But I think

Re: [HACKERS] amcheck (B-Tree integrity checking tool)

2016-10-16 Thread Noah Misch
On Fri, Oct 14, 2016 at 04:56:39PM -0700, Peter Geoghegan wrote: > On Mon, Feb 29, 2016 at 4:09 PM, Peter Geoghegan wrote: > > To recap, the extension adds some SQL-callable functions that verify > > certain invariant conditions hold within some particular B-Tree index. > > These

Re: [HACKERS] macaddr 64 bit (EUI-64) datatype support

2016-10-16 Thread Haribabu Kommi
On Thu, Oct 13, 2016 at 4:10 PM, Vitaly Burovoy wrote: > On 10/12/16, Tom Lane wrote: > >>> but we're > >>> not breaking on-disk compatibility of existing macaddr columns. > > Can I ask why? It will not be a varlen (typstorage will not be >

Re: [HACKERS] Question about behavior of snapshot too old feature

2016-10-16 Thread Masahiko Sawada
On Fri, Oct 14, 2016 at 11:29 PM, Kevin Grittner wrote: > On Fri, Oct 14, 2016 at 8:53 AM, Amit Kapila wrote: >> On Fri, Oct 14, 2016 at 1:40 PM, Masahiko Sawada >> wrote: > >>> For example, I set old_snapshot_threshold = 1min

[HACKERS] Steps inside ExecEndGather

2016-10-16 Thread Kouhei Kaigai
Hello, I'm now trying to carry extra performance statistics on CustomScan (like DMA transfer rate, execution time of GPU kernels, etc...) from parallel workers to the leader process using the DSM segment attached by the parallel-context. We can require an arbitrary length of DSM using

Re: [HACKERS] New SQL counter statistics view (pg_stat_sql)

2016-10-16 Thread Haribabu Kommi
On Fri, Oct 14, 2016 at 7:48 PM, vinayak wrote: > > On 2016/10/12 12:21, Haribabu Kommi wrote: > > I tried changing the pg_stat_sql into row mode and ran the regress suite > to > add different type of SQL commands to the view and ran the pgbench test > on my

Re: [HACKERS] New SQL counter statistics view (pg_stat_sql)

2016-10-16 Thread Haribabu Kommi
On Wed, Oct 12, 2016 at 4:06 PM, vinayak wrote: > > > Thank you for the patch. > > Test: Commands with uppercase and lowercase > > If the tag='select' then it returns the 0 rows but count is actually > increment by 1. > > tag='select' vs tag='SELECT' > >

Re: [HACKERS] Steps inside ExecEndGather

2016-10-16 Thread Kouhei Kaigai
> I'm now trying to carry extra performance statistics on CustomScan > (like DMA transfer rate, execution time of GPU kernels, etc...) > from parallel workers to the leader process using the DSM segment > attached by the parallel-context. > We can require an arbitrary length of DSM using

Re: [HACKERS] Steps inside ExecEndGather

2016-10-16 Thread Amit Kapila
On Mon, Oct 17, 2016 at 6:22 AM, Kouhei Kaigai wrote: > Hello, > > I'm now trying to carry extra performance statistics on CustomScan > (like DMA transfer rate, execution time of GPU kernels, etc...) > from parallel workers to the leader process using the DSM segment >

Re: [HACKERS] amcheck (B-Tree integrity checking tool)

2016-10-16 Thread Michael Paquier
On Mon, Oct 17, 2016 at 10:46 AM, Noah Misch wrote: > - Detect impossible conditions in the hint bits. A tuple should not have both > HEAP_XMAX_COMMITTED and HEAP_XMAX_INVALID. Every tuple bearing > HEAP_ONLY_TUPLE should bear HEAP_UPDATED. HEAP_HASVARWIDTH should be

Re: [HACKERS] Steps inside ExecEndGather

2016-10-16 Thread Kouhei Kaigai
> On Mon, Oct 17, 2016 at 6:22 AM, Kouhei Kaigai wrote: > > Hello, > > > > I'm now trying to carry extra performance statistics on CustomScan > > (like DMA transfer rate, execution time of GPU kernels, etc...) > > from parallel workers to the leader process using the DSM

[HACKERS] minor issue: \c without parameter disconnect current user

2016-10-16 Thread Pavel Stehule
Hi I expect so \c without parameters has only informational character. But \c reset user. postgres=# set role to tom; SET Time: 0.787 ms postgres=> select current_user; +--+ | current_user | +--+ | tom | +--+ (1 row) Time: 0.851 ms postgres=> \c

Re: [HACKERS] Parallel bitmap heap scan

2016-10-16 Thread Dilip Kumar
There is major chance in tidbitmap.c file after efficient hash table commit [1] and my patch need to be rebased. Only parallel-bitmap-heap-scan need to be rebased, all other patch can be applied on head as is. Rebased version (v2) of parallel-bitmap-heap-scan is attached. [1]

Re: [HACKERS] pg_basebackup stream xlog to tar

2016-10-16 Thread Michael Paquier
On Sat, Oct 15, 2016 at 8:51 AM, Magnus Hagander wrote: > Fixed. Ok, I had a extra look on the patch: + The transactionn log files are written to a separate file +called pg_xlog.tar. + s/transactionn/transaction/, and the markup should be on

Re: [HACKERS] New SQL counter statistics view (pg_stat_sql)

2016-10-16 Thread vinayak
On 2016/10/17 10:22, Haribabu Kommi wrote: On Fri, Oct 14, 2016 at 7:48 PM, vinayak > wrote: On 2016/10/12 12:21, Haribabu Kommi wrote: I tried changing the pg_stat_sql into row mode and ran the regress