[GENERAL] txid and current_timestamp

2012-06-25 Thread Vlad Arkhipov
Is it guaranteed that if txid2 > txid1 then current_timestamp in transaction 2 >= current_timestamp in transaction 1? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Calculating Replication Lag - units

2012-06-25 Thread David Kerr
On 6/25/2012 9:55 PM, Raghavendra wrote: On Tue, Jun 26, 2012 at 1:47 AM, David Kerr mailto:d...@mr-paradox.net>> wrote: Howdy, When calculating Replication lag, I know that we have to compare the pg_current_xlog_location to pg_last_xlog_receive_location, etc. but what I'm tryi

Re: [GENERAL] Calculating Replication Lag - units

2012-06-25 Thread Raghavendra
On Tue, Jun 26, 2012 at 1:47 AM, David Kerr wrote: > Howdy, > > When calculating Replication lag, I know that we have to compare the > pg_current_xlog_location > to pg_last_xlog_receive_location, etc. but what I'm trying to figure out > is what are > the units that I'm left with after the calcula

Re: [GENERAL] pgstat wait timeout : permission denied

2012-06-25 Thread Craig Ringer
On 06/26/2012 12:27 AM, pandorino wrote: Hi Craig yes, that's exactly what I did. I have the datadir in a different folder than the executable (because I created a pseudo-portable "database"). I have not set any special exception for the executables, apparently my installation does not need thi

[GENERAL] Minimal streaming replication

2012-06-25 Thread Steve Crawford
I'm attempting to set up minimal/simple replication with one master and one standby using the following pair of identical machines connected through through a 1-Gb switch: 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux PostgreSQL 9.1.4 on x86_64-unkno

Re: [GENERAL] Calculating Replication Lag - units

2012-06-25 Thread David Kerr
On Mon, Jun 25, 2012 at 02:17:22PM -0700, Steve Crawford wrote: - On 06/25/2012 01:17 PM, David Kerr wrote: - >Howdy, - > - >When calculating Replication lag, I know that we have to compare the - >pg_current_xlog_location - >to pg_last_xlog_receive_location, etc. but what I'm trying to figure out

Re: [GENERAL] db server processes hanging around

2012-06-25 Thread Mark Rostron
thank you yes we are continuing to observe connection count. so far we have made changed TCP stack configuration and will continue to observe. mr On Wed, Jun 20, 2012 at 12:53 AM, Sumit Raja < sumit.r...@raja-consulting.co.uk> wrote: > Or ask your Java devs to investigate why the shut down does

Re: [GENERAL] Calculating Replication Lag - units

2012-06-25 Thread Steve Crawford
On 06/25/2012 01:17 PM, David Kerr wrote: Howdy, When calculating Replication lag, I know that we have to compare the pg_current_xlog_location to pg_last_xlog_receive_location, etc. but what I'm trying to figure out is what are the units that I'm left with after the calculation. (i.e., does t

[GENERAL] 08006 Connection Closed

2012-06-25 Thread Marlon Pascoal
Hello guys, I have a application, using PHP/PDO and postgres 8.4 and recently I started getting the errno 08006, which means connection fail. The thing is that my aplication works fine, even in other hosts, but somewhy, i guess when this one is working hardly, by a little time the database reje

[GENERAL] Calculating Replication Lag - units

2012-06-25 Thread David Kerr
Howdy, When calculating Replication lag, I know that we have to compare the pg_current_xlog_location to pg_last_xlog_receive_location, etc. but what I'm trying to figure out is what are the units that I'm left with after the calculation. (i.e., does the xlog_location imply some time value?) He

Re: [GENERAL] 31.11. Notice Processing - associating notices with calls

2012-06-25 Thread Pawel Veselov
On Mon, Jun 25, 2012 at 8:07 AM, Tom Lane wrote: > Pawel Veselov writes: > > What's the best way to "associate" an incoming notice with the statement > > that resulted in generating it? > > Um ... the first issue with this problem statement is the assumption > that there *is* a statement that ca

Re: [GENERAL] pgstat wait timeout : permission denied

2012-06-25 Thread pandorino
Hi Craig yes, that's exactly what I did. I have the datadir in a different folder than the executable (because I created a pseudo-portable "database"). I have not set any special exception for the executables, apparently my installation does not need this. Everything is working fine now, however,

Re: [GENERAL] explain doubt

2012-06-25 Thread Luca Ferrari
On Mon, Jun 25, 2012 at 4:09 PM, Tom Lane wrote: > The short answer though is that this is probably coming from CPU cost > components not disk-access components. Yes of course they are cpu costs, but I'm not able to understand which ones. Is there a way to make PostgreSQL to log the values of the

Re: [GENERAL] row_to_json question

2012-06-25 Thread Merlin Moncure
On Sat, Jun 23, 2012 at 5:15 PM, Joe Van Dyk wrote: > On Sat, Jun 23, 2012 at 3:03 PM, Joe Van Dyk wrote: >> How can I use row_to_json for a subset of columns in a row? (without >> creating a new view or using a CTE?) >> >> What I want returned: >> {"email_address":"j...@tanga.com","username":"jo

Re: [GENERAL] 31.11. Notice Processing - associating notices with calls

2012-06-25 Thread Tom Lane
Pawel Veselov writes: > What's the best way to "associate" an incoming notice with the statement > that resulted in generating it? Um ... the first issue with this problem statement is the assumption that there *is* a statement that caused the notice. The server is capable of generating notices

Re: [GENERAL] UFS2 Snapshots and Postgres

2012-06-25 Thread Vibhor Kumar
On Jun 25, 2012, at 10:34 AM, Eduardo Morras wrote: >>> Thanks in advance >> Snapshots are "safe" (but will result in a roll-forward on restart) IF AND >> ONLY IF the log data and database table spaces are all on the same >> snapshotted volume. >> >> IF THEY ARE NOT then it will probably work

Re: [GENERAL] retrieving function raise messages in ecpg embedded sql code

2012-06-25 Thread Haszlakiewicz, Eric
> -Original Message- > From: Jeff Davis [mailto:pg...@j-davis.com] > > On Mon, 2012-06-18 at 21:35 +, Haszlakiewicz, Eric wrote: > > I'm trying to get some additional information back from a trigger to > > my embedded SQL program, to essentially emulate Informix's way of > generating s

Re: [GENERAL] UFS2 Snapshots and Postgres

2012-06-25 Thread Magnus Hagander
On Mon, Jun 25, 2012 at 4:34 PM, Eduardo Morras wrote: > At 15:16 25/06/2012, you wrote: > > >> On 6/25/2012 7:35 AM, Eduardo Morras wrote: >>> >>> >>> Hi everyone, >>> >>> I'm using FreeBSD 9 for Postgres and want to know if these actions are >>> safe for make a backup of the database: >>> >>> a)

Re: [GENERAL] UFS2 Snapshots and Postgres

2012-06-25 Thread Eduardo Morras
At 15:16 25/06/2012, you wrote: On 6/25/2012 7:35 AM, Eduardo Morras wrote: Hi everyone, I'm using FreeBSD 9 for Postgres and want to know if these actions are safe for make a backup of the database: a) call pg_start_backup('b1') b) take an UFS2 snapshot of data files c) call pg_stop_back

Re: [GENERAL] explain doubt

2012-06-25 Thread Tom Lane
Luca Ferrari writes: > Now, what is the .35 in the cost of the bitmap index scan nodes? If you're going to get picky about second-order cost components, it's time to start reading the source code: http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/optimizer/path/costsize.c;h

Re: [GENERAL] Error message "psql: could not connect to server: No such file or directory"

2012-06-25 Thread Tom Lane
Craig Ringer writes: > On 06/25/2012 04:21 PM, Stefan Schwarzer wrote: >> When I type in: >> >> sudo -u _postgres /usr/local/pgsql-9.1/bin/postgres -D >> /usr/local/pgsql-9.1/data >> >> it spits out: >> >> LOG: 0: could not identify current directory: Permission denied > It's trying to g

[GENERAL] explain doubt

2012-06-25 Thread Luca Ferrari
Hi all, imagine the following simple situation: # CREATE TABLE test( pk serial not null, description text, primary key(pk)); # INSERT INTO test(pk) VALUES(generate_series(1,100 ) ); # VACUUM FULL ANALYZE test; # EXPLAIN SELECT * FROM test WHERE pk = 1 OR pk = 100;

Re: [GENERAL] Help, server doesn't start

2012-06-25 Thread Craig Ringer
On 06/25/2012 09:27 PM, Alban Hertroys wrote: Yes, pg_dump output from 8.3 should restore fine to 9.1. Pardon my ignorance if this changed in recent versions, but shouldn't that read: Yes, pg_dump 9.1 output from 8.3 should restore fine to 9.1? Very good point and an important catch. Thank-you.

Re: [GENERAL] Help, server doesn't start

2012-06-25 Thread Alban Hertroys
> Yes, pg_dump output from 8.3 should restore fine to 9.1. Pardon my ignorance if this changed in recent versions, but shouldn't that read: Yes, pg_dump 9.1 output from 8.3 should restore fine to 9.1? -- If you can't see the forest for the trees, Cut the trees and you'll see there is no forest.

Re: [GENERAL] UFS2 Snapshots and Postgres

2012-06-25 Thread Karl Denninger
On 6/25/2012 7:35 AM, Eduardo Morras wrote: > > Hi everyone, > > I'm using FreeBSD 9 for Postgres and want to know if these actions are > safe for make a backup of the database: > > a) call pg_start_backup('b1') > b) take an UFS2 snapshot of data files > c) call pg_stop_backup() > d) change to th

Re: [GENERAL] Help, server doesn't start

2012-06-25 Thread Craig Ringer
On 06/25/2012 08:02 PM, Anibal David Acosta wrote: We plan to upgrade to version 9.1, do you know if file result of the pg_dump in 8.3 can be restored in 9.1? Yes, pg_dump output from 8.3 should restore fine to 9.1. PLEASE READ THE RELEASE NOTES for the intermediate major versions (8.4 and

[GENERAL] UFS2 Snapshots and Postgres

2012-06-25 Thread Eduardo Morras
Hi everyone, I'm using FreeBSD 9 for Postgres and want to know if these actions are safe for make a backup of the database: a) call pg_start_backup('b1') b) take an UFS2 snapshot of data files c) call pg_stop_backup() d) change to the snapshot dir and rsync/dd/dump/transfer it to backup file

Re: [GENERAL] Help, server doesn't start

2012-06-25 Thread Anibal David Acosta
Some possible scenario of my last problem. 1. Everything was working fine 2. Server get out of space on the Postgres installation disk 3. Some body try to stop and restart the Postgres due to inconvenientes with related services (ignoring the out of space problem) 4.

Re: [GENERAL] Help, server doesn't start

2012-06-25 Thread Anibal David Acosta
shared_preload_libraries changed to '', no more errors about this issue but server doesn't start So, reading some information I found that pg_resetxlog maybe solve the problem, and maybe some data will lose I execute the pg_resetxlog and now everything is working, just god will know what I

[GENERAL] 31.11. Notice Processing - associating notices with calls

2012-06-25 Thread Pawel Veselov
Hi. What's the best way to "associate" an incoming notice with the statement that resulted in generating it? Notice operate on PGResult objects, but these objects only become available after the statement call is made. Should I have a global (or thread global, since my app is MT) "flag" that would

Re: [GENERAL] Error message "psql: could not connect to server: No such file or directory"

2012-06-25 Thread Craig Ringer
On 06/25/2012 04:21 PM, Stefan Schwarzer wrote: I just went back to the postgres documentation [1] (actually reading all google results on the error message one after the other) and tried out what was said there (adapted to my conditions): sudo -u _postgres /usr/local/pgsql-9.1/bin/postgres -D

Re: [GENERAL] Error message "psql: could not connect to server: No such file or directory"

2012-06-25 Thread Stefan Schwarzer
> I just went back to the postgres documentation [1] (actually reading all > google results on the error message one after the other) and tried out what > was said there (adapted to my conditions): > > sudo -u _postgres /usr/local/pgsql-9.1/bin/postgres -D > /usr/local/pgsql-9.1/data > > and s

Re: [GENERAL] Error message "psql: could not connect to server: No such file or directory"

2012-06-25 Thread Craig Ringer
On 06/25/2012 02:50 PM, Stefan Schwarzer wrote: > Craig Ringer wrote: I'm puzzled about why you don't appear to be looking at the server error logs (/usr/local/pgsql-9.1/data/pg_log) during troubleshooting. They're your main source of info. Hmm, I guess it's because I didn't think of it, I wa