[GENERAL] How to distinguish serialization errors from others using pqxx

2015-03-23 Thread Saimon
Hi Is there any way to distinguish serialization errors from others using pqxx? As far as I understand there is no way to get sql error code within pqxx lib. Ability to detect serialization errors is important to implement retrying logic for this cases. -- View this message in context: http:/

Re: [GENERAL] xml

2015-03-23 Thread Pavel Stehule
2015-03-23 15:09 GMT+01:00 Tom Lane : > Pavel Stehule writes: > > result of xmlagg is not valid xml. > > Really? Either that's a bug, or it's declared wrong. > I was not accurate. "" is not valid xml document - and xpath function doens't like it. postgres=# select xpath('//tag/@x',''::xml); ER

Re: [GENERAL] scope quirk in copy in function

2015-03-23 Thread Tom Lane
Adrian Klaver writes: > On 03/23/2015 06:59 AM, Scott Ribe wrote: >> create or replace function archive_some_stuff() returns void as $$ >> declare cutoff timestamptz; >> begin >> cutoff := now() - '1 day'::interval; >> copy (select * from log where end_when < cutoff) to ... > "Variable substituti

Re: [GENERAL] scope quirk in copy in function

2015-03-23 Thread Adrian Klaver
On 03/23/2015 06:59 AM, Scott Ribe wrote: create or replace function archive_some_stuff() returns void as $$ declare cutoff timestamptz; begin cutoff := now() - '1 day'::interval; copy (select * from log where end_when < cutoff) to ... ... Gives me an error that there is column named cu

[GENERAL] Difference between light-weight geometry types

2015-03-23 Thread Igor Stassiy
Hello, is there any difference between LWCOLLECTION and LWCOMPOUND? Has the meaning changed since postgis 1.5 (when liblwgeom wasn't yet packaged) to liblwgeom >= 2.0? Also, what does LWCIRCSTRING stand for? Is it a closed line string? Thanks a lot, Igor

[GENERAL] xml

2015-03-23 Thread Ramesh T
Hi all, SELECT xmlagg(xmlelement( name actor, xmlattributes(first_name) )ORDER BY actor_id,',')from actor; the above code return following result, [image: Inline image 1] Question : i want retrieve result from above XML result like

Re: [GENERAL] xml

2015-03-23 Thread Tom Lane
Pavel Stehule writes: > result of xmlagg is not valid xml. Really? Either that's a bug, or it's declared wrong. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mail

[GENERAL] scope quirk in copy in function

2015-03-23 Thread Scott Ribe
create or replace function archive_some_stuff() returns void as $$ declare cutoff timestamptz; begin cutoff := now() - '1 day'::interval; copy (select * from log where end_when < cutoff) to ... ... Gives me an error that there is column named cutoff. (Other uses of cutoff in queries not ins

Re: [GENERAL] xml

2015-03-23 Thread Pavel Stehule
2015-03-23 12:40 GMT+01:00 Ramesh T : > Hi all, > SELECT xmlagg(xmlelement( > name actor, xmlattributes(first_name) > )ORDER BY actor_id,',')from actor; > > the above code return following result, > > [image: Inline image 1] > Questio

Re: [GENERAL] COPY command file name encoding issue (UTF8/WIN1252)

2015-03-23 Thread Pujol Mathieu
Maybe a new option could be added to let caller specifies the file name encoding, it may know it because he create the source/destination file. I tried to give him a WIN1252 text by doing COPY "test" TO convert_from(convert_to('C:/tmp/é.bin','UTF8'),'WIN1252') WITH BINARY but this call is not al

Re: [GENERAL] COPY command file name encoding issue (UTF8/WIN1252)

2015-03-23 Thread Albe Laurenz
Pujol Mathieu wrote: > I have a problem using COPY command with a file name containing non > ASCII characters. > I use Postgres 9.3.5 x64 on a Windows 7. > OS local encoding is WIN1252. > My database is encoded in UTF8. > I initiate client connection with libpq, connection encoding is set to UTF8.

[GENERAL] COPY command file name encoding issue (UTF8/WIN1252)

2015-03-23 Thread Pujol Mathieu
Hi, I have a problem using COPY command with a file name containing non ASCII characters. I use Postgres 9.3.5 x64 on a Windows 7. OS local encoding is WIN1252. My database is encoded in UTF8. I initiate client connection with libpq, connection encoding is set to UTF8. I build properly my file