Re: [GENERAL] Problem with pg_dump and decimal mark

2014-11-28 Thread Adrian Klaver
On 11/28/2014 02:08 PM, Tom Lane wrote: Adrian Klaver writes: On 11/28/2014 05:35 AM, Eric Svenson wrote: I have done a backup of a postgres database on a virtual machine (Windows 8.1) using pg_dump. On another (non-virtual) machine the restore (with psql) worked without problems. On the thi

Re: [GENERAL] Problem with pg_dump and decimal mark

2014-11-28 Thread Tom Lane
Adrian Klaver writes: > On 11/28/2014 05:35 AM, Eric Svenson wrote: >> I have done a backup of a postgres database on a virtual machine >> (Windows 8.1) using pg_dump. >> >> On another (non-virtual) machine the restore (with psql) worked without >> problems. >> >> On the third virtual machine, h

Re: [GENERAL] Problem with pg_dump and decimal mark

2014-11-28 Thread Adrian Klaver
On 11/28/2014 05:35 AM, Eric Svenson wrote: Hello, I have done a backup of a postgres database on a virtual machine (Windows 8.1) using pg_dump. On another (non-virtual) machine the restore (with psql) worked without problems. On the third virtual machine, however, the restore fails. (ERROR:

[GENERAL] Problem with pg_dump and decimal mark

2014-11-28 Thread Eric Svenson
Hello, I have done a backup of a postgres database on a virtual machine (Windows 8.1) using pg_dump. On another (non-virtual) machine the restore (with psql) worked without problems. On the third virtual machine, however, the restore fails. (ERROR: invalid input syntax for type double precision

[GENERAL] Synchronous Replication Timeout

2014-11-28 Thread Teresa Bradbury
Hi, I have a replication setup with a master and a single synchronous slave. If the slave dies (or the network goes down) I would like any transaction on the master that requires writing to fail so I can roll it back. At the moment, when I commit it just hangs forever or (if I cancel it using ^

Re: [GENERAL] PG94RC1- plv8 functions - problem with input parameter length

2014-11-28 Thread Adrian Klaver
On 11/28/2014 12:18 PM, Misa Simic wrote: On Friday, November 28, 2014, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 11/28/2014 07:56 AM, Misa Simic wrote: Hi all, We have found a strange problem with plv8 functions in PG94RC1 PG 9.3 works fine.

Re: [GENERAL] PG94RC1- plv8 functions - problem with input parameter length

2014-11-28 Thread Misa Simic
On Friday, November 28, 2014, Adrian Klaver wrote: > On 11/28/2014 07:56 AM, Misa Simic wrote: > >> Hi all, >> >> We have found a strange problem with plv8 functions in PG94RC1 >> >> PG 9.3 works fine. >> >> in PG94RC1 in plv8 functions regardless what function does i.e.nothing >> >> CREATE OR RE

Re: [GENERAL] Converting xml to table with optional elements

2014-11-28 Thread David Johnston
On Fri, Nov 28, 2014 at 10:47 AM, Andrus wrote: > Hi! > > Thank you. > > Instead of defining an xpath for fields define one that captures the xml >> pertaining to the data that would belong to >> a single record.How to create single xpath or xsl which assigns values to >> all columns in Postgres

Re: [GENERAL] Converting xml to table with optional elements

2014-11-28 Thread Andrus
Hi! Thank you. Instead of defining an xpath for fields define one that captures the xml pertaining to the data that would belong to a single record.How to create single xpath or xsl which assigns values to all columns in Postgres table ? I havent found such sample. Samples which I have found c

Re: [GENERAL] PG94RC1- plv8 functions - problem with input parameter length

2014-11-28 Thread Adrian Klaver
On 11/28/2014 08:05 AM, Misa Simic wrote: Update: all works fine and with: PostgreSQL 9.4beta1 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit Installed 9.4rc1 and tried with a plpgsql function and it worked with parameters >= 200, so it seems plV8 specif

Re: [GENERAL] PG94RC1- plv8 functions - problem with input parameter length

2014-11-28 Thread Adrian Klaver
On 11/28/2014 07:56 AM, Misa Simic wrote: Hi all, We have found a strange problem with plv8 functions in PG94RC1 PG 9.3 works fine. in PG94RC1 in plv8 functions regardless what function does i.e.nothing CREATE OR REPLACE FUNCTION test.test_text_length_plv8(in_param1 text) RETURNS text AS $BOD

Re: [GENERAL] Converting xml to table with optional elements

2014-11-28 Thread David Johnston
On Fri, Nov 28, 2014 at 9:40 AM, Andrus wrote: > Hi! > > Thank you. >>Subquery the xpath expression to unnest it and apply a LIMIT 1 > > UPDATE tbl SET ... = (SELECT xpath( tbl.???[...] ) LIMIT 1) > > I used unnest() : > ​Sorry, I meant to say (SELECT unnest(xpath(tbl.???[...])) LIMIT 1

Re: [GENERAL] Converting xml to table with optional elements

2014-11-28 Thread Andrus
Hi! Thank you. >Subquery the xpath expression to unnest it and apply a LIMIT 1 > UPDATE tbl SET ... = (SELECT xpath( tbl.???[...] ) LIMIT 1) I used unnest() : update temprid set ContactFirstName =unnest(xpath( '/E-Document/Document/DocumentParties/BuyerParty/ContactData/ContactFirstName/

Re: [GENERAL] PG94RC1- plv8 functions - problem with input parameter length

2014-11-28 Thread Misa Simic
2014-11-28 16:56 GMT+01:00 Misa Simic : > Hi all, > > We have found a strange problem with plv8 functions in PG94RC1 > > PG 9.3 works fine. > > in PG94RC1 in plv8 functions regardless what function does i.e.nothing > > CREATE OR REPLACE FUNCTION test.test_text_length_plv8(in_param1 text) > RETURNS

Re: [GENERAL] Converting xml to table with optional elements

2014-11-28 Thread David Johnston
On Fri, Nov 28, 2014 at 4:17 AM, Andrus wrote: > Hi! > > You have to process this in two passes. First pass you create a table of >> documents by unnesting the non-optional >Document elements. Second pass you >> explode each individual row/document on that table into its components. >> > > Thank

[GENERAL] PG94RC1- plv8 functions - problem with input parameter length

2014-11-28 Thread Misa Simic
Hi all, We have found a strange problem with plv8 functions in PG94RC1 PG 9.3 works fine. in PG94RC1 in plv8 functions regardless what function does i.e.nothing CREATE OR REPLACE FUNCTION test.test_text_length_plv8(in_param1 text) RETURNS text AS $BODY$ return 'OK' $BODY$ LANGUAGE plv8; if len

Re: [GENERAL] Converting xml to table with optional elements

2014-11-28 Thread Andrus
Hi! You have to process this in two passes. First pass you create a table of documents by unnesting the non-optional >Document elements. Second pass you explode each individual row/document on that table into its components. Thank you. I tried code below. John Smith appears in result as "{"J