Re: [GENERAL] MongoDB 3.2 beating Postgres 9.5.1?

2016-03-15 Thread pbj
Your results are close enough to mine, I think, to prove the point.   And, I agree that the EDB benchmark is not necessary reflective of a real-world scenario. However, the cache I'm referring to is PG's shared_buffer cache.   You can see the first run of the select causing a lot of disk reads. 

Re: [GENERAL] How to Qualifying or quantify risk of loss in asynchronous replication

2016-03-15 Thread Thomas Munro
On Wed, Mar 16, 2016 at 6:26 AM, otheus uibk wrote: > I've been working with PG 9.1.8 for two years now, mainly asynchronous > replication. Recently, an IT admin of another group contested that the PG's > asynchronous replication can result in loss of data in a 1-node

Re: [GENERAL] Unique UUID value - PostgreSQL 9.2

2016-03-15 Thread David G. Johnston
On Tue, Mar 15, 2016 at 2:48 PM, drum.lu...@gmail.com wrote: > > >>> I wouldn't ask if I wouldn't have tested it! >>> >>> Will have a look. >>> >>> ​ >> I didn't asked if you tested what you did post. I asked if you tried >> anything else before asking to be fed the

Re: [GENERAL] Unique UUID value - PostgreSQL 9.2

2016-03-15 Thread John R Pierce
On 3/15/2016 2:48 PM, drum.lu...@gmail.com wrote: It's already working: INSERT INTO junk.wm_260_billables2 (account_id, code, info) SELECT account_id, 'test_' || uuid_generate_v4(), info FROM junk.wm_260_billables1; BUT.. I'm getting a very long UUID - Would like some smaller

Re: [GENERAL] Unique UUID value - PostgreSQL 9.2

2016-03-15 Thread drum.lu...@gmail.com
> >>> >> I wouldn't ask if I wouldn't have tested it! >> >> Will have a look. >> >> ​ > I didn't asked if you tested what you did post. I asked if you tried > anything else before asking to be fed the answer. If you did it would be > nice to include those other attempts. > > David J. > ​ > >

Re: [GENERAL] Unique UUID value - PostgreSQL 9.2

2016-03-15 Thread David G. Johnston
On Tue, Mar 15, 2016 at 2:35 PM, drum.lu...@gmail.com wrote: > > > On 16 March 2016 at 10:30, David G. Johnston > wrote: > >> On Tue, Mar 15, 2016 at 2:01 PM, drum.lu...@gmail.com < >> drum.lu...@gmail.com> wrote: >> >>> > Not reading

Re: [GENERAL] Unique UUID value - PostgreSQL 9.2

2016-03-15 Thread drum.lu...@gmail.com
On 16 March 2016 at 10:30, David G. Johnston wrote: > On Tue, Mar 15, 2016 at 2:01 PM, drum.lu...@gmail.com < > drum.lu...@gmail.com> wrote: > >> >>> Not reading the documentation for functions you've never heard of makes >>> the list. >>> >>> David J. >>> >> >>

Re: [GENERAL] Unique UUID value - PostgreSQL 9.2

2016-03-15 Thread David G. Johnston
On Tue, Mar 15, 2016 at 2:01 PM, drum.lu...@gmail.com wrote: > >>> >> Not reading the documentation for functions you've never heard of makes >> the list. >> >> David J. >> > > INSERT INTO junk.test1 (account_id, code, info)SELECT account_id, > uuid_generate_v4(), infoFROM

Re: [GENERAL] Unique UUID value - PostgreSQL 9.2

2016-03-15 Thread drum.lu...@gmail.com
> > >> > Not reading the documentation for functions you've never heard of makes > the list. > > David J. > INSERT INTO junk.test1 (account_id, code, info)SELECT account_id, uuid_generate_v4(), infoFROM junk.test2; It works but I get data like: abc77f31-0ee6-44fd-b954-08a3a3aa7b28

[GENERAL] Re: how to switch old replication Master to new Standby after promoting old Standby - pg_rewind log file missing

2016-03-15 Thread John Lumby
> Date: Tue, 15 Mar 2016 17:21:50 +0100 > Subject: Re: how to switch old replication Master to new Standby after > promoting old Standby - pg_rewind log file missing > From: michael.paqu...@gmail.com > To: johnlu...@hotmail.com > CC: pgsql-general@postgresql.org; oleksandr.shul...@zalando.de; >

[GENERAL] Re: how to switch old replication Master to new Standby after promoting old Standby - pg_rewind log file missing

2016-03-15 Thread Michael Paquier
On Tue, Mar 15, 2016 at 5:14 PM, John Lumby wrote: > But my question is, given that the divergence point was 2B60, > why is it looking for a file earlier than that? (please do not top-post, this is annoying as it breaks the logic of the thread) pg_rewind begins

Re: [GENERAL] pg_dump crashing

2016-03-15 Thread Michael Paquier
On Tue, Mar 15, 2016 at 4:10 PM, Matthias Schmitt wrote: > since two weeks I am trying to get PostgreSQL 9.5.1 to run on Debian 8.3. > Everything is fine except the daily backup. When calling pg_dump as part of a > cron job pg_dump crashes: > > 2016-03-15 01:00:02

[GENERAL] Re: how to switch old replication Master to new Standby after promoting old Standby - pg_rewind log file missing

2016-03-15 Thread John Lumby
I have already hit a different problem with pg_rewind and would like to check my understanding. The problem is,  on 9.5.1 ,  pg_rewind fails to find a log file that it thinks it needs : pg_rewind -D ${pg_cluster_dir} --source-server='host=10.19.0.1 port=5432 xxx' -P --debug

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Francisco Olarte
Hi Melvin: On Tue, Mar 15, 2016 at 3:57 PM, Melvin Davidson wrote: > What you really want is > "ON_ERROR_STOP ... > So just > SET ON_ERROR_STOP = ON > before any other statements IIRC you are right with the variable ... BUT .. it is a psql setting, not a session setting,

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Albe Laurenz
John McKown wrote: > I'm likely abusing the psql program. What I have is an awk program which > reads a file and produces a > number of INSERT INTO commands. I then feed these commands into psql to > execute them. Yes, a Perl > program would be a better idea. Anyway, sometimes the commands are

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread John McKown
On Tue, Mar 15, 2016 at 9:57 AM, Melvin Davidson wrote: > > > On Tue, Mar 15, 2016 at 10:49 AM, John McKown < > john.archie.mck...@gmail.com> wrote: > >> On Tue, Mar 15, 2016 at 9:38 AM, Adrian Klaver > > wrote: >> >>> On 03/15/2016 07:33 AM,

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Melvin Davidson
On Tue, Mar 15, 2016 at 10:49 AM, John McKown wrote: > On Tue, Mar 15, 2016 at 9:38 AM, Adrian Klaver > wrote: > >> On 03/15/2016 07:33 AM, John McKown wrote: >> >>> I'm likely abusing the psql program. What I have is an awk program which

[GENERAL] psql question: aborting a "script"

2016-03-15 Thread John McKown
I'm likely abusing the psql program. What I have is an awk program which reads a file and produces a number of INSERT INTO commands. I then feed these commands into psql to execute them. Yes, a Perl program would be a better idea. Anyway, sometimes the commands are rejected due to some problem,

Re: [GENERAL] Re: how to switch old replication Master to new Standby after promoting old Standby

2016-03-15 Thread Adrian Klaver
On 03/15/2016 06:54 AM, John Lumby wrote: Thank you both for the advice. pg_rewind is a nice utility and not only more robust than what I came up with but also easier to use and avoids need to shut down new Primary. Re editing the wiki, I do have a community account but it seems I need more

[GENERAL] Re: how to switch old replication Master to new Standby after promoting old Standby

2016-03-15 Thread John Lumby
Thank you both for the advice. pg_rewind is a nice utility and not only more robust than what I came up with but also easier to use and avoids need to shut down new Primary. Re editing the wiki,  I do have a community account but it seems I need more than that :    ==>  Editing this

Re: [GENERAL] Unexpected result using floor() function

2016-03-15 Thread Frank Millman
On Tue, Mar 15, 2016 at 12:02 PM, Francisco Olarte wrote: > Hi Frank: > > This may byte you any day, so I wuld recommend doing > > s=> select v, pg_typeof(v) from (select floor(4.725 * power(cast(10 as > numeric), 2) + 0.5)) as aux(v); > v | pg_typeof > -+--- > 473 | numeric >

Re: [GENERAL] Unexpected result using floor() function

2016-03-15 Thread Francisco Olarte
Hi Frank: On Tue, Mar 15, 2016 at 6:57 AM, Frank Millman wrote: > 2. As pointed out, there are two forms of the power function. > > test=> select pg_typeof(power(10, 2)); > pg_typeof > -- > double precision > > test=> select pg_typeof(power(10., 2)); >

Re: [GENERAL] Unexpected result using floor() function

2016-03-15 Thread Frank Millman
> I am running PostgreSQL 9.4.4 on Fedora 22. > > SELECT floor(4.725 * 100 + 0.5) returns 473, which is what I expected. > > SELECT floor(4.725 * power(10, 2) + 0.5) returns 472, which I find surprising. > > Please can someone explain the anomaly. I think I have a solution to my problem, but I