Re: [GENERAL] pg_rewind copy so much data

2017-09-28 Thread Michael Paquier
On Fri, Sep 29, 2017 at 1:06 PM, Hung Phan wrote: > I used tablespace to store data and it seems to be that pg_rewind copied > everthing in the tablespace. Today I found an article posted by you (Michael > Paquier) and you said that there was no tablespace support. If so,

[GENERAL] PG 10 and perl

2017-09-28 Thread Andy Colson
I'm not subscribed to the -devel list, so hopefully I can post this here. I'm running slackware 14.2 I have the system perl (5.24) installed, and also perlbrew with perl 5.26 installed. In PG 9.5 this worked fine, and compiling and running PG used the 5.26 version of perl:

Re: [GENERAL] pg_rewind copy so much data

2017-09-28 Thread Hung Phan
Sorry for the late reply. I have checked those relfilenodes and they have existed. I used tablespace to store data and it seems to be that pg_rewind copied everthing in the tablespace. Today I found an article posted by you (Michael Paquier) and you said that there was no tablespace support. If

Re: [GENERAL] Function to return per-column counts?

2017-09-28 Thread Melvin Davidson
On Thu, Sep 28, 2017 at 3:31 PM, Seamus Abshere wrote: > > > > Does anybody have a function lying around (preferably pl/pgsql) that > > > > takes a table name and returns coverage counts? > > > > > > What is "coverage count"? > > Ah, I should have explained better. I meant

Re: [GENERAL] Function to return per-column counts?

2017-09-28 Thread Seamus Abshere
> > > Does anybody have a function lying around (preferably pl/pgsql) that > > > takes a table name and returns coverage counts? > > > > What is "coverage count"? Ah, I should have explained better. I meant how much of a column is null. Basically you have to 0. count how many total records in a

Re: [GENERAL] Function to return per-column counts?

2017-09-28 Thread John McKown
On Thu, Sep 28, 2017 at 12:15 PM, Tomas Vondra wrote: > > > On 09/28/2017 04:34 PM, Seamus Abshere wrote: > > hey, > > > > Does anybody have a function lying around (preferably pl/pgsql) that > > takes a table name and returns coverage counts? > > > > What is

Re: [GENERAL] many many open files on pgsql_tmp with size 0

2017-09-28 Thread Tom Lane
francis cherat writes: > when i execute a huge sql query on my database (version 9.3), i see many many > open files (36) on pgsql_tmp with size 0. > This files are deleted where the query is done. Hmm. Can we see the query that causes this, and maybe EXPLAIN ANALYZE

Re: [GENERAL] Function to return per-column counts?

2017-09-28 Thread Tomas Vondra
On 09/28/2017 04:34 PM, Seamus Abshere wrote: > hey, > > Does anybody have a function lying around (preferably pl/pgsql) that > takes a table name and returns coverage counts? > What is "coverage count"? cheers -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL

[GENERAL] pg_stat_tmp and pg_upgrade

2017-09-28 Thread
With Pg10.0 coming, I have a question about pg_stat_tmp and upgrades that I'm hoping I can get some advice on. Historically, we've created a tmpfs "disk" and mounted it on $PGDATA/pg_stat_tmp and then started Pg. For most situations, this works well. However, we have one situation where it

Re: [GENERAL] Catching errors inside a LOOP is causing performance issues

2017-09-28 Thread David G. Johnston
On Thu, Sep 28, 2017 at 1:08 AM, Denisa Cirstescu < denisa.cirste...@tangoe.com> wrote: > Hi Tom, > > You said that trapping an *arbitrary* exception is a “fairly expensive > mechanism”. > ​I suppose a better (though maybe not perfectly accurate) wording is that setting up the pl/pgsql execution

[GENERAL] Function to return per-column counts?

2017-09-28 Thread Seamus Abshere
hey, Does anybody have a function lying around (preferably pl/pgsql) that takes a table name and returns coverage counts? e.g. #> select * from column_counts('cats'::regclass); column_name | all_count | present_count | null_count | coverage | --- name | 300 |

Re: [GENERAL] Catching errors inside a LOOP is causing performance issues

2017-09-28 Thread Pavel Stehule
2017-09-28 10:08 GMT+02:00 Denisa Cirstescu : > Hi Tom, > > > > You said that trapping an *arbitrary* exception is a “fairly expensive > mechanism”. > > What if the: > > > > begin > > …. > > exception when others > > then null; > > end; > > > > would be

Re: [GENERAL] Catching errors inside a LOOP is causing performance issues

2017-09-28 Thread Denisa Cirstescu
Hi Tom, You said that trapping an arbitrary exception is a “fairly expensive mechanism”. What if the: begin …. exception when others then null; end; would be replaced with begin …. exception when NO_DATA_FOUND then null; end; When the code is catching a certain

[GENERAL] many many open files on pgsql_tmp with size 0

2017-09-28 Thread francis cherat
HI when i execute a huge sql query on my database (version 9.3), i see many many open files (36) on pgsql_tmp with size 0. This files are deleted where the query is done. This behavior impact the max inodes limite on the FS. Is this expected behavior ? Regards Francis

Re: [GENERAL] WAL Archive command.

2017-09-28 Thread John Britto
Hi, I am running streaming replication with the archive. As you can see below that Master pg_xlog is at WAL: 000101330093. But archive_status shows way behind: 000101330088.done What could be the reason behind this? How should I let the PostgreSQL archive the WAL from