[GENERAL] postgres standby won't start

2015-10-05 Thread Ramalingam, Sankarakumar
We have a standby set up between two sites in two different locations. The replication was going on well and suddenly it stopped due to error 2015-09-08 16:07:51 EDT LOG: streaming replication successfully connected to primary 2015-09-08 16:07:51 EDT FATAL: could not receive data from WAL

Re: [GENERAL] postgres standby won't start

2015-10-05 Thread Andreas Kretschmer
Ramalingam, Sankarakumar wrote: > We have a standby set up between two sites in two different locations. The > replication was going on well and suddenly it stopped due to error > > 2015-09-08 16:07:51 EDT LOG: streaming replication successfully connected to

Re: [GENERAL] postgres standby won't start

2015-10-05 Thread Adrian Klaver
On 10/05/2015 10:53 AM, Ramalingam, Sankarakumar wrote: We have a standby set up between two sites in two different locations. The replication was going on well and suddenly it stopped due to error 2015-09-08 16:07:51 EDT LOG: streaming replication successfully connected to primary 2015-09-08

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Adrian Klaver
On 10/05/2015 11:39 AM, Raymond O'Donnell wrote: Hello all, I have an SQL problem which ought to be simple, but I can't get my head around it. I have pairs of integers - let's call them (x, y). In effect, x is a category, while y is an item within that category. For every x, there is always

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Raymond O'Donnell
On 05/10/2015 20:03, John McKown wrote: > When in doubt, cheat! Why not something like: > > SELECT x, y FROM organ_pipes WHERE point(x,y) <@ > box(point(?x1,?y1),point(?x2,?y2)) ; > > This is definitely a different approach from the others that I've seen. > > > Basically, think of your channel

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Chris Mair
I then might want to extract a list from, say, (1, 3) to (3, 2), giving: x | y - 1 | 3 1 | 4 2 | 1 2 | 2 2 | 3 2 | 4 3 | 1 3 | 2 For the life of me, I can't figure out how to do this. Hi, starting from this: chris=# select * from t order by x,y; x | y ---+--- 1 | 1 1 | 2 1 | 3 1 |

[GENERAL] Selecting pairs of numbers

2015-10-05 Thread Raymond O'Donnell
Hello all, I have an SQL problem which ought to be simple, but I can't get my head around it. I have pairs of integers - let's call them (x, y). In effect, x is a category, while y is an item within that category. For every x, there is always the same number of integers y; and both x and y are

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Adrian Klaver
On 10/05/2015 12:00 PM, Raymond O'Donnell wrote: On 05/10/2015 19:53, Adrian Klaver wrote: On 10/05/2015 11:39 AM, Raymond O'Donnell wrote: Hello all, I have an SQL problem which ought to be simple, but I can't get my head around it. I have pairs of integers - let's call them (x, y). In

Re: [GENERAL] md5(large_object_id)

2015-10-05 Thread Karsten Hilbert
On Mon, Oct 05, 2015 at 03:27:26PM +, Kevin Grittner wrote: > Karsten Hilbert wrote: > > > I am dealing with radiology studies aka DICOM data) one would > > want an md5 function which streams in parts of a large object > > piece by piece using md5_update and

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread John McKown
When in doubt, cheat! Why not something like: SELECT x, y FROM organ_pipes WHERE point(x,y) <@ box(point(?x1,?y1),point(?x2,?y2)) ; This is definitely a different approach from the others that I've seen. Basically, think of your channel / piston as a point in a Cartesian plane. And your

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Raymond O'Donnell
On 05/10/2015 19:53, Adrian Klaver wrote: > On 10/05/2015 11:39 AM, Raymond O'Donnell wrote: >> Hello all, >> >> I have an SQL problem which ought to be simple, but I can't get my head >> around it. >> >> I have pairs of integers - let's call them (x, y). In effect, x is a >> category, while y is

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Raymond O'Donnell Sent: Monday, October 05, 2015 2:40 PM To: 'PostgreSQL' Subject: [GENERAL] Selecting pairs of numbers Hello all, I have

[GENERAL] How to reduce pg_dump backup time

2015-10-05 Thread Sachin Srivastava
Dear Team, I am using PostgreSQL 9.1 on Redhat Linux on my Production environment. My database size is 680 GB and it take 7 hour for completion the pg_dump backup. I want that my pg_dump backup should be fast and take less time. In PostgresQL 9.3 there is “ -j *njobs” *option is available

Re: [GENERAL] BDR Rejoin of failed node, hangs.

2015-10-05 Thread Craig Ringer
On 5 October 2015 at 20:58, Steve Pribyl wrote: > Clean up node 1. >select bdr.bdr_part_by_node_names('{node2}'); >delete from bdr.bdr_nodes where node_status='k'; You need to delete the bdr.bdr_connections entry too. 0.9.3 will fix that, so orphan connections

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Charles Clavadetscher
> aklaver@test=> create table pr_test(x int, y int); > > aklaver@test=> select * from pr_test where (x, y) between (1, 3) and > (3,2) order by x,y; > x | y > ---+--- > 1 | 3 > 1 | 4 > 2 | 1 > 2 | 2 > 2 | 3 > 2 | 4 > 3 | 1 > 3 | 2 +1, nice. -- Sent via pgsql-general mailing

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Raymond O'Donnell
On 05/10/2015 20:08, Adrian Klaver wrote: > On 10/05/2015 12:00 PM, Raymond O'Donnell wrote: >> On 05/10/2015 19:53, Adrian Klaver wrote: >>> On 10/05/2015 11:39 AM, Raymond O'Donnell wrote: Hello all, I have an SQL problem which ought to be simple, but I can't get my head

Re: [GENERAL] postgres standby won't start

2015-10-05 Thread Ramalingam, Sankarakumar
Thanks Adrian. My primary is doing fine. Only the standby. I am noticing it after a while..my Bad!! Primary setting #-- # REPLICATION #--

[GENERAL] Database size on disk

2015-10-05 Thread Quiroga, Damian
Hi, I'm looking for some advice on how to determine the DB size on disk to trigger some cleanup tasks (deleting old data) if some threshold is reached. Let's say that for simplicity I don't want to ask for the size on disk to the OS, but rather to PostgreSQL itself. And I only have a single

Re: [GENERAL] Database size on disk

2015-10-05 Thread dinesh kumar
On Mon, Oct 5, 2015 at 12:47 PM, Quiroga, Damian wrote: > Hi, > > > > I’m looking for some advice on how to determine the DB size on disk to > trigger some cleanup tasks (deleting old data) if some threshold is reached. > > > > Let’s say that for simplicity I don’t want

Re: [GENERAL] Getting a leading zero on negative intervals with to_char?

2015-10-05 Thread Bruce Momjian
On Wed, May 13, 2015 at 01:40:41PM -0400, Bruce Momjian wrote: > > I can't find any way to produce the output '-09:00' . There's no apparent > > way > > to add an additional width-specifier. HH24 is clearly not constrained to be > > 2 > > digits wide, since "-11" and "101" and "-101" are all

Re: [GENERAL] to_number, to_char inconsistency.

2015-10-05 Thread Bruce Momjian
On Thu, May 14, 2015 at 01:02:01PM -0400, Bruce Momjian wrote: > On Sun, Feb 10, 2013 at 06:27:02PM -0500, Tom Lane wrote: > > Jeremy Lowery writes: > > > I load and dump text files with currency values in it. The decimal in > > > these > > > input and output formats in

Re: [GENERAL] Serialization errors despite KEY SHARE/NO KEY UPDATE

2015-10-05 Thread Kevin Grittner
[Sorry for the delay in responding -- was on vacation.] Jim Nasby wrote: > On 10/2/15 11:44 AM, Olivier Dony wrote: >> On 10/02/2015 12:28 AM, Jim Nasby wrote: >>> On 9/29/15 9:47 AM, Olivier Dony wrote: -- Setup tables CREATE TABLE users ( id serial PRIMARY

[GENERAL] Try to understand VACUUM and its settings

2015-10-05 Thread Michael Chau
Hi, Last Friday, I ran : postgres=# select max(age(datfrozenxid)) from pg_database; max 42579490 and then I ran : SELECT relname, age(relfrozenxid) as xid_age, pg_size_pretty(pg_table_size(oid)) as table_size FROM pg_class WHERE relkind = 'r' and pg_table_size(oid) > 1073741824 ORDER BY

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Adrian Klaver
On 10/05/2015 12:33 PM, Raymond O'Donnell wrote: On 05/10/2015 20:08, Adrian Klaver wrote: On 10/05/2015 12:00 PM, Raymond O'Donnell wrote: On 05/10/2015 19:53, Adrian Klaver wrote: On 10/05/2015 11:39 AM, Raymond O'Donnell wrote: Hello all, I have an SQL problem which ought to be simple,

Re: [GENERAL] Replication with 9.4

2015-10-05 Thread Thomas Munro
On Sun, Oct 4, 2015 at 11:47 PM, Michael Paquier wrote: > (Seems like you forgot to push the Reply-all button) > > On Sun, Oct 4, 2015 at 7:01 PM, Madovsky wrote: >> On 10/3/2015 3:30 PM, Michael Paquier wrote: >>> and no reason is given to justify *why* this would be

Re: [GENERAL] postgres standby won't start

2015-10-05 Thread Adrian Klaver
On 10/05/2015 12:35 PM, Ramalingam, Sankarakumar wrote: Thanks Adrian. My primary is doing fine. Only the standby. I am noticing it after a while..my Bad!! Primary setting #-- # REPLICATION

Re: [GENERAL] Unexpected query result

2015-10-05 Thread Adrian Klaver
On 10/05/2015 05:02 AM, Begin Daniel wrote: In order to process a large amount of data I need to run a procedure using parallel batch processes. The query I run in each process is expected to ... 1- select a bunch of id (500) in a table (wait4processing) containing the list of all records to

Re: [GENERAL] Best way to sync table DML between databases

2015-10-05 Thread Bill Moran
On Mon, 5 Oct 2015 06:20:28 -0700 (MST) jimbosworth wrote: > Hi All, > > I have two servers each running pg9.4.4 database instances. > I need to determine the best way to keep a large 20gb table on server A > synchronised onto server B... > > At the moment, I use pg_dump

[GENERAL] Unexpected query result

2015-10-05 Thread Begin Daniel
In order to process a large amount of data I need to run a procedure using parallel batch processes. The query I run in each process is expected to ... 1- select a bunch of id (500) in a table (wait4processing) containing the list of all records to process2- remove selected records from

[GENERAL] Best way to sync table DML between databases

2015-10-05 Thread jimbosworth
Hi All, I have two servers each running pg9.4.4 database instances. I need to determine the best way to keep a large 20gb table on server A synchronised onto server B... At the moment, I use pg_dump to periodically dump the table on server A, then psql to reload into server B. This is fine,

Re: [GENERAL] Best way to sync table DML between databases

2015-10-05 Thread jimbosworth
Thanks Bill, but is there no way to just track row changes on a postgres table without using 3rd party replication solutions or a patched version of postgres? Im not in a position to change the database setup on server A. Server B is mine to maintain, hence why postgres_fdw and some means of

Re: [GENERAL] Unexpected query result

2015-10-05 Thread Begin Daniel
Thank Adrian, it makes sense. I'll adapt the calling procedures Daniel > Subject: Re: [GENERAL] Unexpected query result > To: jfd...@hotmail.com; pgsql-general@postgresql.org > From: adrian.kla...@aklaver.com > Date: Mon, 5 Oct 2015 06:17:33 -0700 > > On 10/05/2015 05:02 AM, Begin Daniel wrote:

Re: [GENERAL] Unexpected query result

2015-10-05 Thread dinesh kumar
Hi, On Mon, Oct 5, 2015 at 5:02 AM, Begin Daniel wrote: > In order to process a large amount of data I need to run a procedure using > parallel batch processes. > The query I run in each process is expected to ... > > It seems, you are trying to achieve the same, what we

Re: [GENERAL] md5(large_object_id)

2015-10-05 Thread Kevin Grittner
Karsten Hilbert wrote: > I am dealing with radiology studies aka DICOM data) one would > want an md5 function which streams in parts of a large object > piece by piece using md5_update and m5_finalize or some such. It would certainly be possible to write a lo_md5(oid)

Re: [GENERAL] BDR Rejoin of failed node, hangs.

2015-10-05 Thread Steve Pribyl
Good Morning, Has anyone had a moment to look at this? It is a bit of a show stopper. Thanks Steve From: pgsql-general-ow...@postgresql.org on behalf of Steve Pribyl Sent: Thursday, October