Re: [GENERAL] how to do merge in postgres ("with upsert as" not supported)

2015-02-27 Thread Jim Nasby
On 2/26/15 2:23 PM, Tong Michael wrote: I saw some people use "with upsert as", but my pgAdmin version(1.8) doesn't support it. Anyone has any ideas how to do merge in postgres? Actually, this feature is in active development and will hopefully make it into 9.5. In the meantime, take a l

Re: [GENERAL] Re: [pgadmin-support] Issue with a hanging apply process on the replica db after vacuum works on primary

2015-02-27 Thread Jim Nasby
On 2/26/15 12:25 AM, Sergey Shchukin wrote: Hi Radovan ! Thank you for the reply. The question is that this table is not a subject for a massive updates/deletes. Is there any additional traces except from perf or pg_top to trace what replica is doing at the particular moment when we are lagging

Re: [GENERAL] how to do merge in postgres ("with upsert as" not supported)

2015-02-27 Thread Thomas Kellerer
Tong Michael schrieb am 26.02.2015 um 21:23: > > hey, guys, I came across a merge statement when I'm trying to convert stored > procedures from Mysql to Postgres: > > __ __ > > merge into db.ChargePeriod d > using ( > select ba.ClientID > ... > ... That can't be MySQL - MyS

Re: [GENERAL] Regarding "Point-in-time Recovery" feature

2015-02-27 Thread Jim Nasby
On 2/23/15 5:39 AM, Saurabh Gupta A wrote: Hello, Has anybody used online backup feature of postgreSQL? In fact precise postgreSQL term is called: "Point-in-time Recovery" (PITR) This means enabling following additional options in config: --- archive_command = on archive_command = 'cp %p /usr/lo

Re: [GENERAL] express composite type literal as text

2015-02-27 Thread Jim Nasby
On 2/21/15 7:35 PM, Eric Hanson wrote: Hi, I'm trying to use a composite type in a WHERE clause, as described here: http://www.postgresql.org/docs/9.4/static/rowtypes.html Just pasting in the examples I get: CREATE TYPE complex AS ( r double precision, i double precision

Re: [GENERAL] Re: [pgadmin-support] Issue with a hanging apply process on the replica db after vacuum works on primary

2015-02-27 Thread Sergey Shchukin
27.02.2015 11:52, Jim Nasby пишет: On 2/26/15 12:25 AM, Sergey Shchukin wrote: Hi Radovan ! Thank you for the reply. The question is that this table is not a subject for a massive updates/deletes. Is there any additional traces except from perf or pg_top to trace what replica is doing at the p

Re: [GENERAL] Re: [pgadmin-support] Issue with a hanging apply process on the replica db after vacuum works on primary

2015-02-27 Thread Sergey Shchukin
27.02.2015 14:11, Sergey Shchukin пишет: 27.02.2015 11:52, Jim Nasby пишет: On 2/26/15 12:25 AM, Sergey Shchukin wrote: Hi Radovan ! Thank you for the reply. The question is that this table is not a subject for a massive updates/deletes. Is there any additional traces except from perf or pg_t

[GENERAL] Performance on DISABLE TRIGGER

2015-02-27 Thread gmb
Hi all I'm doing some maintenance - which is done quite often, never had this problem before - which requires me to disable triggers, run some updates and then re-enable the triggers. Where the whole process normally take 30 sec , it took much longer today and I cancelled after 5 minutes. After

Re: [GENERAL] range type expression syntax

2015-02-27 Thread John Turner
On Fri, 27 Feb 2015 02:57:15 -0500, Marc Mamin wrote: postgres=# select concat('[', now()::date, ',', now()::date, ']')::daterange testrange; There are range specific functions for this: select daterange(now()::date, now()::date, '[]') regards, Marc Mamin Marc, thanks - indeed it's righ

[GENERAL] Pass a URI as a pgAdmin parameter

2015-02-27 Thread Clodoaldo Neto
I can connect to Heroku with psql passing a URI as generated by http://api.postgression.com: $ psql postgres://hcnkrxukvhqiww:lryfxzcmlboytgtxpsvla8h...@ec2-107-21-93-97.compute-1.amazonaws.com:5432/dearu2qcqcmi7t I want to do the same with pgAdmin: $ pgadmin3 -qc postgres://hcnkrxukvhqiww:lry

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Melvin Call
On 2/26/15, Vick Khera wrote: > On Thu, Feb 26, 2015 at 9:50 PM, Melvin Call > wrote: > >> Montreal where the e is an accented e. The output ends up in the text >> file >> as >> Montr\xe9al, where the xe9 is a single character. When I try to copy that >> into >> my PostgreSQL table, I get an erro

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Melvin Call
On 2/27/15, Adam Hooper wrote: > On Thu, Feb 26, 2015 at 9:50 PM, Melvin Call > wrote: > >> So my question is, how do I sanitize the hex character in the middle of a >> word >> to be able to copy in Montreal with an accented e? Or am I going about >> this at >> the wrong point? > > Hi Melvin, > >

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Adrian Klaver
On 02/27/2015 06:39 AM, Melvin Call wrote: On 2/26/15, Vick Khera wrote: On Thu, Feb 26, 2015 at 9:50 PM, Melvin Call wrote: Montreal where the e is an accented e. The output ends up in the text file as Montr\xe9al, where the xe9 is a single character. When I try to copy that into my Postgre

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Melvin Call
On Fri, Feb 27, 2015 at 8:58 AM, Adam Hooper wrote: > On Fri, Feb 27, 2015 at 9:39 AM, Melvin Call wrote: >> On 2/26/15, Vick Khera wrote: > >>> Character code E9 is not UTF8. Don't tell Postgres you're importing UTF8 if >>> you're not. >>> >> Thank you Vic, adding the ENCODING 'latin1' option t

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Melvin Call
On Fri, Feb 27, 2015 at 9:03 AM, Adrian Klaver wrote: > On 02/27/2015 06:39 AM, Melvin Call wrote: >> >> On 2/26/15, Vick Khera wrote: >>> >>> On Thu, Feb 26, 2015 at 9:50 PM, Melvin Call >>> wrote: >>> Montreal where the e is an accented e. The output ends up in the text file as

Re: [GENERAL] Triggers on foreign Postgres 9.3 tables in Postgres 9.4

2015-02-27 Thread MattF
Thank you Michael! I will let the admin know then! -- View this message in context: http://postgresql.nabble.com/Triggers-on-foreign-Postgres-9-3-tables-in-Postgres-9-4-tp5839559p5839749.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mai

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Adrian Klaver
On 02/27/2015 07:55 AM, Melvin Call wrote: On Fri, Feb 27, 2015 at 9:03 AM, Adrian Klaver wrote: On 02/27/2015 06:39 AM, Melvin Call wrote: On 2/26/15, Vick Khera wrote: On Thu, Feb 26, 2015 at 9:50 PM, Melvin Call wrote: Montreal where the e is an accented e. The output ends up in the

Re: [GENERAL] Performance on DISABLE TRIGGER

2015-02-27 Thread Greg Sabino Mullane
binK_rPgnIklP.bin Description: charset

[GENERAL] 'missing' data on replicate

2015-02-27 Thread Alan Nilsson
I have 4 machines in a cluster: 1 master & 2 replicates (hot standby mode) on OSX, 1 replicate (hot standby mode) on Linux (centos6.5). All replicates were created with pg_basebackup (+ X option). I have a table that returns no results when queried by the primary key on the replicate running o

Re: [GENERAL] 'missing' data on replicate

2015-02-27 Thread David G Johnston
Alan Nilsson wrote > I have 4 machines in a cluster: 1 master & 2 replicates (hot standby mode) > on OSX, 1 replicate (hot standby mode) on Linux (centos6.5). All > replicates were created with pg_basebackup (+ X option). > > I have a table that returns no results when queried by the primary key

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Adam Hooper
On Fri, Feb 27, 2015 at 9:39 AM, Melvin Call wrote: > On 2/26/15, Vick Khera wrote: >> On Thu, Feb 26, 2015 at 9:50 PM, Melvin Call >> wrote: >> >>> I get an error "ERROR: invalid byte sequence for >>> encoding "UTF8": 0xe9616c" >> >> Character code E9 is not UTF8. Don't tell Postgres you're im

Re: [GENERAL] 'missing' data on replicate

2015-02-27 Thread Adrian Klaver
On 02/27/2015 10:04 AM, David G Johnston wrote: Alan Nilsson wrote I have 4 machines in a cluster: 1 master & 2 replicates (hot standby mode) on OSX, 1 replicate (hot standby mode) on Linux (centos6.5). All replicates were created with pg_basebackup (+ X option). I have a table that returns no

Re: [GENERAL] 'missing' data on replicate

2015-02-27 Thread Alan Nilsson
Thank you for that, makes sense. Another fine example of RTFM! alan > On Feb 27, 2015, at 10:04 AM, David G Johnston > wrote: > > Alan Nilsson wrote >> I have 4 machines in a cluster: 1 master & 2 replicates (hot standby mode) >> on OSX, 1 replicate (hot standby mode) on Linux (centos6.5). A

Re: [GENERAL] Hex characters in COPY input

2015-02-27 Thread Melvin Call
On Fri, Feb 27, 2015 at 12:02 PM, Adam Hooper wrote: > On Fri, Feb 27, 2015 at 9:39 AM, Melvin Call wrote: >> On 2/26/15, Vick Khera wrote: >>> On Thu, Feb 26, 2015 at 9:50 PM, Melvin Call >>> wrote: >>> I get an error "ERROR: invalid byte sequence for encoding "UTF8": 0xe9616c" >>>

Re: [GENERAL] 'missing' data on replicate

2015-02-27 Thread Adrian Klaver
On 02/27/2015 10:14 AM, Alan Nilsson wrote: Thank you for that, makes sense. Another fine example of RTFM! To go with my previous post, I knew this sounded familiar: http://www.postgresql.org/message-id/cadyruxojwgkh4ghxw2heqetfapiwzayj9uwg34bhyifxlrm...@mail.gmail.com in particular this res