pg_update to a new machine?

2018-02-23 Thread Ron Johnson
The 2.8TB database must be moved to a new server in a new Data Center, and upgraded from 8.4.17 to 9.6.6 Will this work? pg_upgrade --old-datadir "CURSERVER://var/lib/pgsql/data" --new-datadir "NEWSERVER://var/lib/pgsql/data" --old-bindir "CURSERVER://usr/bin"

Re: Given a set of daterange, finding the continuous range that includes a particular date (aggregates)

2018-02-23 Thread Ken Tanzer
> > On Fri, Feb 23, 2018 at 6:10 AM, mariusz wrote: > i guess, you can easily get max continuous range for each row with > something like this: > > CREATE OR REPLACE FUNCTION > append_daterange(d1 daterange, d2 daterange) > RETURNS daterange > LANGUAGE

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-23 Thread Ken Tanzer
On Fri, Feb 23, 2018 at 6:42 AM, Viktor Fougstedt wrote: > > Hi. > > This answer is perhaps useful if I understand your problem correctly. But > I might have interpreted it wrongly. :-) > > > I would probably start with merging intervals so that overlapping and > adjacent

Re: Query error: could not resize shared memory segment

2018-02-23 Thread Thomas Munro
On Wed, Jan 3, 2018 at 6:34 PM, Tom Lane wrote: > Thomas Munro writes: >> On Wed, Jan 3, 2018 at 6:13 PM, Thuc Nguyen Canh >> wrote: >>> mount | grep /dev/shm >>> => shm on /dev/shm type tmpfs

Re: Location to specify C compiler option in C extension

2018-02-23 Thread Demitri Muna
Hi Tom, > PG_CPPFLAGS ought to work. One point is that you need to set that before > including pgxs.mk; maybe it's an ordering problem? On closer inspection, it was working, but the pg Makefile was specifically including “-Wdeclaration-after-statement” which I think was overriding the

Re: Location to specify C compiler option in C extension

2018-02-23 Thread Tom Lane
Demitri Muna writes: > I’m writing a C extension and have successfully based my Makefile on existing > templates. This conveniently hides the details of the full Makefile provided > by "pg_config --pgxs”. Which variable would be the appropriate one to specify > the

Re: PQConsumeinput stuck on recv

2018-02-23 Thread Andres Freund
Hi, On 2018-02-23 15:59:18 -0300, Andre Oliveira Freitas wrote: > I'm using the libpq that comes with debian, however I can install the > library from the official repository to be sure, I assume the one from > the official repo has it enabled. That should be fine. Could you get the backtrace

Re: PQConsumeinput stuck on recv

2018-02-23 Thread Andre Oliveira Freitas
2018-02-23 14:20 GMT-03:00 Andres Freund : > > Hi, > > On 2018-02-23 13:33:18 -0300, Andre Oliveira Freitas wrote: > > Since it's been happening for a few weeks now, every time it freezes we > > take a gcore dump and check it in gdb... and after a lot of hair pulling > > and

Trigger file behavior with the standby

2018-02-23 Thread Keiko Oda
Hello, I'm seeing the following behavior with a trigger file which is very confusing to me, I'd like to get some advice of what is the expected behavior of the trigger file with the standby. 1. setup the replication, with the standby having the following recovery.conf # we use wal-e

Location to specify C compiler option in C extension

2018-02-23 Thread Demitri Muna
Hi, I’m writing a C extension and have successfully based my Makefile on existing templates. This conveniently hides the details of the full Makefile provided by "pg_config --pgxs”. Which variable would be the appropriate one to specify the ‘-std=c99’ compiler flag? I’ve tried many and still

Re: Getting a primitive numeric value from "DatumGetNumeric"?

2018-02-23 Thread Demitri Muna
Hi, On Feb 22, 2018, at 9:31 PM, Michael Paquier wrote: > PG_GETARG_NUMERIC(), no? That function returns an object of datatype “Numeric” which still requires some (not immediately obvious) conversation to a double (or whatever primitive C type). > When working on

Re: PQConsumeinput stuck on recv

2018-02-23 Thread Andres Freund
Hi, On 2018-02-23 13:33:18 -0300, Andre Oliveira Freitas wrote: > Since it's been happening for a few weeks now, every time it freezes we > take a gcore dump and check it in gdb... and after a lot of hair pulling > and learning about the innards of the VoIP software we see that most often > the

PQConsumeinput stuck on recv

2018-02-23 Thread Andre Oliveira Freitas
Hi, I've been experiencing an issue. We use an open-source VoIP software whose backend is PostgreSQL. Initially we had a twin-server setup (one server running the VoIP software, another one running the pg instance). Due to company growth we were running into performance issues, so we rolled out a

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-23 Thread Viktor Fougstedt
Hi. This answer is perhaps useful if I understand your problem correctly. But I might have interpreted it wrongly. :-) I would probably start with merging intervals so that overlapping and adjacent intervals become single continuous intervals, then select from those merged intervals. We

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-23 Thread mariusz
On Thu, 2018-02-22 at 17:23 -0800, Ken Tanzer wrote: > > > On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver > wrote: > On 02/22/2018 04:58 PM, Ken Tanzer wrote: > > > > On Thu, Feb 22, 2018 at 4:53 PM,

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-23 Thread PT
On Fri, 23 Feb 2018 17:10:56 +1300 David Rowley wrote: > On 23 February 2018 at 04:00, Bill Moran wrote: > > 2) The negative impact of an unused index is tiny compared to the negative > > impact of a missing index. > > I'd say that would