Re: [GENERAL] master-side counterpart of pg_last_xact_replay_timestamp?

2011-09-08 Thread Simon Riggs
On Thu, Sep 8, 2011 at 6:43 AM, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Sep 8, 2011 at 7:06 AM, Chris Redekop ch...@replicon.com wrote: Is there anything available to get the last time a transaction occurred?like say pg_last_xact_timestamp? No.  In order to accurately calculate

[GENERAL] Select Output in XML format

2011-09-08 Thread Adarsh Sharma
Dear all, Today I need to write the output of an postgres table into XML format. I think there is an easiest way to do this but not able to find it. In mysql there is simple query for that : mysql -X -e select * from db_name.master /hdd2-1/test.xml In postgres , i find some XML data types

Re: [GENERAL] master-side counterpart of pg_last_xact_replay_timestamp?

2011-09-08 Thread Fujii Masao
On Thu, Sep 8, 2011 at 3:19 PM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, Sep 8, 2011 at 6:43 AM, Fujii Masao masao.fu...@gmail.com wrote: Your complaint makes sense. I'll implement something like pg_last_xact_timestamp() for 9.2. But unfortunately there is no way to know such a

Re: [GENERAL] Select Output in XML format

2011-09-08 Thread Craig Ringer
On 8/09/2011 2:41 PM, Adarsh Sharma wrote: Dear all, Today I need to write the output of an postgres table into XML format. I think there is an easiest way to do this but not able to find it. http://www.postgresql.org/docs/current/static/functions-xml.html Use the query_to_xml or

Re: [GENERAL] Select Output in XML format

2011-09-08 Thread Chetan Suttraway
On Thu, Sep 8, 2011 at 12:11 PM, Adarsh Sharma adarsh.sha...@orkash.comwrote: Dear all, Today I need to write the output of an postgres table into XML format. I think there is an easiest way to do this but not able to find it. In mysql there is simple query for that : mysql -X -e select *

Re: [GENERAL] Select Output in XML format

2011-09-08 Thread Adarsh Sharma
Thanks I am trying as below ; db_name=# select table_to_xml(tbl master, nulls boolean, tableforest boolean, targetns text); ERROR: syntax error at or near master LINE 1: select table_to_xml(tbl master, nulls boolean, tableforest b... ^ Do I

Re: [GENERAL] 8.4 - 9.0 upgrade difficulties

2011-09-08 Thread Devrim GÜNDÜZ
Hi, On Wed, 2011-09-07 at 17:09 -0700, Steve Crawford wrote: snip Upon reading that the RPMS are now being built so that multiple versions can peacefully coexist. That feature is available for: * RHEL/SL/CentOS 4,5 - PostgreSQL 9.0+ * RHEL/SL/CentOS 6 - PostgreSQL 8.4+ So, since you are

Re: [GENERAL] Lock problem

2011-09-08 Thread Eduardo Piombino
I'm sorry Tom. This happens (at least) both in 8.4 and 9.0. I've just tested it in 2 different databases with the same results. I have workarounds to this, but I was wondering what could be the actual root of the problem, in order to (try to) achieve the best solution possible. Following is a

Re: [GENERAL] Select Output in XML format

2011-09-08 Thread Chetan Suttraway
On Thu, Sep 8, 2011 at 12:53 PM, Adarsh Sharma adarsh.sha...@orkash.comwrote: Thanks I am trying as below ; db_name=# select table_to_xml(tbl master, nulls boolean, tableforest boolean, targetns text); ERROR: syntax error at or near master LINE 1: select table_to_xml(tbl master, nulls

Re: [GENERAL] Select Output in XML format

2011-09-08 Thread Chetan Suttraway
On Thu, Sep 8, 2011 at 12:53 PM, Adarsh Sharma adarsh.sha...@orkash.comwrote: Thanks I am trying as below ; db_name=# select table_to_xml(tbl master, nulls boolean, tableforest boolean, targetns text); ERROR: syntax error at or near master LINE 1: select table_to_xml(tbl master, nulls

[GENERAL] feature request - update nowait

2011-09-08 Thread Eduardo Piombino
Hi, would it be possible to implement a *nowait *modifier to the *update*statement in order to tell it not to wait and raise an error -just like a select for update nowait would-, instead of defaulting to waiting forever until the lock becomes available? The lack of such a modifier nowadays

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread Simon Riggs
On Thu, Sep 8, 2011 at 10:01 AM, Eduardo Piombino drak...@gmail.com wrote: Hi, would it be possible to implement a nowait modifier to the update statement in order to tell it not to wait and raise an error -just like a select for update nowait would-, instead of defaulting to waiting forever

Re: [GENERAL] pivoting data?

2011-09-08 Thread Joy Smith
Hello Chris, yes that does seem to be a lot cleaner - though it does one thing that is not right - ie) add to the previous data insert into modvalues (parties,baloons,color,dayofpurchase,amountpur) values ('1','big','red','1/2/2011',4); then the output looks like: baloons colorjan

Re: [GENERAL] pivoting data?

2011-09-08 Thread Sim Zacks
On 09/08/2011 03:15 PM, Joy Smith wrote: Hello Chris, yes that does seem to be a lot cleaner - though it does one thing that is not right - ie) add to the previous data insert into modvalues (parties,baloons,color,dayofpurchase,amountpur) values

Re: [GENERAL] conditional insert

2011-09-08 Thread Lincoln Yeoh
At 03:51 AM 9/8/2011, Merlin Moncure wrote: yeah -- but you only need to block selects if you are selecting in the inserting transaction (this is not a full upsert). if both writers are doing: begin; lock table foo exclusive; insert into foo select ... where ...; commit; is good enough. btw

Re: [GENERAL] conditional insert

2011-09-08 Thread Lincoln Yeoh
At 03:51 AM 9/8/2011, Merlin Moncure wrote: Don't you have to block SELECTs so that the SELECTs get serialized? Otherwise concurrent SELECTs can occur at the same time, find no existing rows, then all the inserts proceed and you get errors (or dupes). That's how Postgresql still works

Re: [GENERAL] conditional insert

2011-09-08 Thread Merlin Moncure
On Thu, Sep 8, 2011 at 9:14 AM, Lincoln Yeoh ly...@pop.jaring.my wrote: At 03:51 AM 9/8/2011, Merlin Moncure wrote: Don't you have to block SELECTs so that the SELECTs get serialized? Otherwise concurrent SELECTs can occur at the same time, find no existing rows, then all the inserts

Re: [GENERAL] conditional insert

2011-09-08 Thread Lincoln Yeoh
At 04:04 AM 9/8/2011, Andrew Sullivan wrote: On Wed, Sep 07, 2011 at 02:51:32PM -0500, Merlin Moncure wrote: @andrew s: going SERIALIZABLE doesn't help if you trying to eliminate cases that would push you into retrying the transaction. Well, no, of course. But why not catch the failure and

Re: [GENERAL] pivoting data?

2011-09-08 Thread Joy Smith
You'll want to group by baloons,color and probably take a sum of each of the case statements. Sim yes, hard to believe I did not notice that. Thank you, the working query is: select baloons, color, max(case when dayofpurchase = '2011-01-01' then amountpur ELSE NULL END) as first, max(CASE when

Re: [GENERAL] conditional insert

2011-09-08 Thread Andrew Sullivan
On Thu, Sep 08, 2011 at 10:31:39PM +0800, Lincoln Yeoh wrote: Doesn't catching the failure and retrying mean writing more code? Well, yes. OTOH, if you want to use upsert and you have to use other database systems too, then you'll need that other code also, since it's not standard. There

[GENERAL] problems with pg_restore and java

2011-09-08 Thread Miguel Angel Hernandez Moreno
Hello I have a program in java to make a backup running pg_restore, If you use linux give a successful outcome. but if you use windows I mark an error generating the socket. I think that it could be the environment variables in Windows. My java code is as follows. String comando=; String

Re: [GENERAL] problems with pg_restore and java

2011-09-08 Thread Merlin Moncure
On Thu, Sep 8, 2011 at 10:45 AM, Miguel Angel Hernandez Moreno miguel.hdz@gmail.com wrote: Hello I have a program in java to make a backup running pg_restore, If you use linux give a successful outcome. but if you use windows I mark an error generating the socket. I think that it could

[GENERAL] PSQLRestore

2011-09-08 Thread Bob Pawley
Hi I’m having problems making PostgreDAC’s PSQLRestore work without an access violation. Could someone please point me to an example code that I can check? (My PSQLDump is working well, so I am using a valid restore file.) Bob

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread Merlin Moncure
On Thu, Sep 8, 2011 at 4:01 AM, Eduardo Piombino drak...@gmail.com wrote: Hi, would it be possible to implement a nowait modifier to the update statement in order to tell it not to wait and raise an error -just like a select for update nowait would-, instead of defaulting to waiting forever

Re: [GENERAL] problems with pg_restore and java

2011-09-08 Thread Miguel Angel Hernandez Moreno
Sorry This is the error that sends me pg_restore: connecting to database for restore pg_restore: [archiver (db)] connection to database postgres failed: could not create socket: Unknown socket error (0x277A/10106) pg_restore: *** aborted because of error And this is the value of my

Re: [GENERAL] problems with pg_restore and java

2011-09-08 Thread Miguel Angel Hernandez Moreno
sorry comando=: C:\Program Files\pgAdmin III\1.12\pg_restore.exe -h 192.170.1.89 -d postgres -U postgres -v -1 C:\Users\Miguel\Documents\ NetBeansProjects\file.backup 2011/9/8 Miguel Angel Hernandez Moreno miguel.hdz@gmail.com Sorry This is the error that sends me pg_restore:

Re: [GENERAL] problems with pg_restore and java

2011-09-08 Thread Miguel Angel Hernandez Moreno
If I leave the trust authentication server, the program runs correctly. change is that the exec () does not add the env variable 2011/9/8 Miguel Angel Hernandez Moreno miguel.hdz@gmail.com sorry comando=: C:\Program Files\pgAdmin III\1.12\pg_restore.exe -h 192.170.1.89 -d postgres -U

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread pasman pasmański
Try a command LOCK NOWAIT 2011/9/8, Eduardo Piombino drak...@gmail.com: Hi, would it be possible to implement a *nowait *modifier to the *update*statement in order to tell it not to wait and raise an error -just like a select for update nowait would-, instead of defaulting to waiting forever

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread Eduardo Piombino
Nice. Much more maintainable IMO and quite close to what I was looking for. Thanks a lot for the suggestion, I will definitely try it/implement it right away. Still has some redundancy compared to an hypothetical nowait modifier but I think it's the very best alternative so far. Eduardo On Thu,

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread Eduardo Piombino
I'm sorry, isn't it meant for table locks? I was talking about row level locking. Eduardo 2011/9/8 pasman pasmański pasma...@gmail.com Try a command LOCK NOWAIT 2011/9/8, Eduardo Piombino drak...@gmail.com: Hi, would it be possible to implement a *nowait *modifier to the

Re: [GENERAL] PSQLRestore

2011-09-08 Thread Adrian Klaver
On 09/08/2011 09:09 AM, Bob Pawley wrote: Hi I’m having problems making PostgreDAC’s PSQLRestore work without an access violation. The exact error message is? Could someone please point me to an example code that I can check? (My PSQLDump is working well, so I am using a valid restore file.)

[GENERAL] streaming question regarding archive files

2011-09-08 Thread akp geek
Hi all - We are using 9.0.4 on solaris. We set up the streaming. it is running fine. The files keep accumulating in archive directory. Do we need to keep all the files or is there a limit that , how many days worth of files we need to keep. We do take hot back up of the primary

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread Merlin Moncure
On Thu, Sep 8, 2011 at 1:22 PM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Sep 8, 2011 at 4:01 AM, Eduardo Piombino drak...@gmail.com wrote: Hi, would it be possible to implement a nowait modifier to the update statement in order to tell it not to wait and raise an error -just like

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread Merlin Moncure
On Thu, Sep 8, 2011 at 4:32 PM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Sep 8, 2011 at 1:22 PM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Sep 8, 2011 at 4:01 AM, Eduardo Piombino drak...@gmail.com wrote: Hi, would it be possible to implement a nowait modifier to the update

Re: [GENERAL] PSQLRestore

2011-09-08 Thread Bob Pawley
-Original Message- From: Adrian Klaver Sent: Thursday, September 08, 2011 1:41 PM To: Bob Pawley Cc: Postgresql Subject: Re: [GENERAL] PSQLRestore On 09/08/2011 09:09 AM, Bob Pawley wrote: Hi I’m having problems making PostgreDAC’s PSQLRestore work without an access violation. The

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread Eduardo Piombino
Don't worry ! I will surely try some different alternatives anyways, but the idea is the same, include somehow a select for update in the same sentence as the update. I'm most inclined to the last one you suggested, maybe with an equals instead of an in (I'd rather always instinctively use an

Re: [GENERAL] PSQLRestore

2011-09-08 Thread Raymond O'Donnell
On 08/09/2011 23:02, Bob Pawley wrote: The problem seems to be in this code which I am using to transfer from the opendialogue to PSQLRestore. FileRestore := OpenDialog1.FileName; PSQLRestore1.RestoreFromFile(FileRestore, ' '); I'm not sure what string is expected. Hello Bob,

Re: [GENERAL] PSQLRestore

2011-09-08 Thread Bob Pawley
-Original Message- From: Raymond O'Donnell Sent: Thursday, September 08, 2011 3:23 PM To: Bob Pawley Cc: Adrian Klaver ; Postgresql Subject: Re: [GENERAL] PSQLRestore On 08/09/2011 23:02, Bob Pawley wrote: The problem seems to be in this code which I am using to transfer from

Re: [GENERAL] 8.4 - 9.0 upgrade difficulties

2011-09-08 Thread Steve Crawford
On 09/08/2011 12:48 AM, Devrim GÜNDÜZ wrote: So, since you are using CentOS 5, you may not be able to install 8.4 and 9.0 in parallel. ... Just did a fully clean purge of 8.4 and install of 9.0. Not sure where to report packaging errors but upon running /etc/init.d/postgresql-9.0 it