Re: Connection terminated but client didn't realise

2019-12-02 Thread David Wheeler
> Is the application remote from the database server? My gut reaction to this > type of report is "something timed out the network connection", but there > would have to be a router or firewall or the like in between to make that a > tenable explanation. > If that is the issue, you should be

Re: Upgrading from V11 to V12 on Debian install

2019-12-02 Thread Adrian Klaver
On 12/2/19 11:28 AM, stan wrote: I have several machines that have version 11 instances on them. These are all Debian or Ubuntu machines. All of them are pointed to the Postgres repositories fro the Postgres binaries deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main dpkg -l shows:

Upgrading from V11 to V12 on Debian install

2019-12-02 Thread stan
I have several machines that have version 11 instances on them. These are all Debian or Ubuntu machines. All of them are pointed to the Postgres repositories fro the Postgres binaries deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main dpkg -l shows: ii postgresql-11

Preformance on upcoming Linux kernel

2019-12-02 Thread stan
Just wanted to point out this article: https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.5-Early-Performance Looks like something has changed between 5.4 and 5.5 that is degrading postgresql performance. -- "They that would give up essential liberty for temporary safety deserve neit

Re: using replace function

2019-12-02 Thread Antonio Silva
Hi Osvaldo, Rod, David and Tom Thanks for your attention. Lastly it is not that difficult. For me the more natural way is Rod's suggestion, to use replace with where. I don't know why I didn't think of this solution. The usage of regexp_replace is very nice too and I will take a time to learn i

Re: slow insert speeds with bytea

2019-12-02 Thread Steve Atkins
On 01/12/2019 17:59, Alex O'Ree wrote: Is there anything I can to increase insert speeds for bytea? Currently running postgres 9.6.15 I have a few tables without a bytea and a few with bytea. There is a large performance difference with inserts between the two. I'm inserting a byte[] that's

Re: slow insert speeds with bytea

2019-12-02 Thread Adrian Klaver
On 12/1/19 9:59 AM, Alex O'Ree wrote: Is there anything I can to increase insert speeds for bytea? Currently running postgres 9.6.15 I have a few tables without a bytea and a few with bytea. There is a large performance difference with inserts between the two. I'm inserting a byte[] that's us

Re: pgbackrest concerns and doubts.

2019-12-02 Thread David Steele
Hi Ajay, On 12/2/19 1:52 AM, Ajay Pratap wrote: I am using Postgresql 10 and pgbackrest 2.18 version on centos 7.6 I have few doubts regard pgbackrest. a) what is the log rotation policy for pgbackrest logs. I see it logs on default path /var/log/pgbackrest/-.logĀ  what is the log rotation pol

Re: Connection terminated but client didn't realise

2019-12-02 Thread Tom Lane
David Wheeler writes: > We have a query that our system runs nightly to refresh materialised views. > This takes some time to execute (~25 minutes) and then it will usually return > the results to the application and everything is golden. However occasionally > we see something like the below,

Re: Conditional return of aggregated data

2019-12-02 Thread Alban Hertroys
On Mon, 2 Dec 2019 at 12:11, Laura Smith wrote: > > My initial idea was something along the lines of : > select (select sum(statcount) from stats_residence) as > aggstat,statcount,short_name_en from stats_residence where > aggstat>some_number; > One option is to move the aggregate to the where-

Re: Conditional return of aggregated data

2019-12-02 Thread Laura Smith
> > or this > with t as > (select (select sum(statcount) from stats_residence) as aggstat, > statcount,short_name_en from stats_residence > ) > select * from t where aggstat > some_number > > Apology if I did not understand the question correctly. Hi Ravi, Thanks for helping show me the way. Yo

Re: Conditional return of aggregated data

2019-12-02 Thread Ravi Krishna
> > > My initial idea was something along the lines of : > > select (select sum(statcount) from stats_residence) as > > aggstat,statcount,short_name_en from stats_residence where > > aggstat>some_number; > > Am I missing something basic. The above can be done using > GROUP BY and HAVING claus

Re: Conditional return of aggregated data

2019-12-02 Thread Ravi Krishna
> My initial idea was something along the lines of : > select (select sum(statcount) from stats_residence) as > aggstat,statcount,short_name_en from stats_residence where > aggstat>some_number; Am I missing something basic. The above can be done using GROUP BY and HAVING clause.

Re: Conditional return of aggregated data

2019-12-02 Thread Wim Bertels
Hallo Laura, i don't know if i understand your question fully, but this might be helpfull?: FILTER SELECT count(*) AS unfiltered, count(*) FILTER (WHERE i < 5) AS filtered FROM generate_series(1,10) AS s(i); unfiltered | filtered +-- 10 |4 (1 row) ht

Conditional return of aggregated data

2019-12-02 Thread Laura Smith
Hi, I have some aggregated statistics which are currently being queried as follows: create view stats_age as SELECT a.category, a.statcount, b.a_desc FROM reg_aggregated_stats a,regs_select_age b where a.category='age' and a.datapoint::smallint=b.a_val order by a.datapoint asc; Ho

slow insert speeds with bytea

2019-12-02 Thread Alex O'Ree
Is there anything I can to increase insert speeds for bytea? Currently running postgres 9.6.15 I have a few tables without a bytea and a few with bytea. There is a large performance difference with inserts between the two. I'm inserting a byte[] that's usually less than 1MB on content. The content