Re: [GENERAL] Locking question

2016-10-26 Thread Frank Millman
From: Frank Millman Sent: Wednesday, October 26, 2016 10:42 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Locking question > I am designing an inventory application, and I want to ensure that the stock > level of any item cannot go negative. Thanks to all for some really great replie

Re: [GENERAL] Remove Standby (SLAVE) from Primary (MASTER) - Postgres9.1

2016-10-26 Thread melvin6925
It's simple just look in recovery. conf on slave and put stated trigger. then slave becomes stand alone.  Sent via the Samsung Galaxy S® 6, an AT&T 4G LTE smartphone Original message From: Adrian Klaver Date: 10/26/16 19:50 (GMT-05:00) To: Michael Paquier , Joanna Xu Cc:

Re: [GENERAL] Remove Standby (SLAVE) from Primary (MASTER) - Postgres9.1

2016-10-26 Thread Adrian Klaver
On 10/26/2016 04:43 PM, Michael Paquier wrote: On Wed, Oct 26, 2016 at 11:18 PM, Joanna Xu wrote: I’ve been looking for a procedure (step by step) on how to remove Standby (SLAVE) from Primary (MASTER) for Postgres9.1 in google and the archived postings, but no luck. Standby and master server

Re: [GENERAL] Remove Standby (SLAVE) from Primary (MASTER) - Postgres9.1

2016-10-26 Thread Michael Paquier
On Wed, Oct 26, 2016 at 11:18 PM, Joanna Xu wrote: > I’ve been looking for a procedure (step by step) on how to remove Standby > (SLAVE) from Primary (MASTER) for Postgres9.1 in google and the archived > postings, but no luck. Standby and master servers are two separate Postgres instances. So if

Re: [GENERAL] SERIALIZABLE and INSERTs with multiple VALUES

2016-10-26 Thread Kevin Grittner
On Wed, Oct 26, 2016 at 3:20 PM, Peter Geoghegan wrote: > On Mon, Oct 24, 2016 at 8:07 AM, Kevin Grittner wrote: >> My initial thought is that since reducing the false positive rate >> would only help when there was a high rate of conflicts under the >> existing patch, and it would add code compl

Re: [GENERAL] SERIALIZABLE and INSERTs with multiple VALUES

2016-10-26 Thread Peter Geoghegan
On Mon, Oct 24, 2016 at 8:07 AM, Kevin Grittner wrote: > My initial thought is that since reducing the false positive rate > would only help when there was a high rate of conflicts under the > existing patch, and it would add code complexity and cost for the > case where conflict rate is low, that

Re: [GENERAL] Limiting to sub-id in a query ?

2016-10-26 Thread David G. Johnston
On Wed, Oct 26, 2016 at 9:22 AM, Tim Smith wrote: > Hi, > > I've been trying various GROUP BY but these all end up erroring out, > so maybe I'm using the wrong tool for the job (or, more likely, the > required query is beyond my level of SQL-fu !). > > CREATE TABLE IF NOT EXISTS names ( > main_id

[GENERAL] Limiting to sub-id in a query ?

2016-10-26 Thread Tim Smith
Hi, I've been trying various GROUP BY but these all end up erroring out, so maybe I'm using the wrong tool for the job (or, more likely, the required query is beyond my level of SQL-fu !). CREATE TABLE IF NOT EXISTS names ( main_id bigint, sub_id bigint, name text ); create unique index IF NOT E

Re: [GENERAL] Locking question

2016-10-26 Thread Kevin Grittner
On Wed, Oct 26, 2016 at 3:42 AM, Frank Millman wrote: > I am designing an inventory application, and I want to ensure > that the stock level of any item cannot go negative. One way to do this is to use only transactions at the SERIALIZABLE transaction isolation level to maintain and query this d

[GENERAL] Remove Standby (SLAVE) from Primary (MASTER) - Postgres9.1

2016-10-26 Thread Joanna Xu
Hello, I've been looking for a procedure (step by step) on how to remove Standby (SLAVE) from Primary (MASTER) for Postgres9.1 in google and the archived postings, but no luck. Can someone please shed some light on how to implement this? Here's the assumption / expectation : 1. The rep

Re: [GENERAL] Integer fields and auto-complete clients

2016-10-26 Thread Steve Atkins
> On Oct 26, 2016, at 6:59 AM, Tim Smith wrote: > > Hi, > > I'm curious as to what the current advice would be in relation to > auto-complete type applications (e.g. "AJAX" type java-script "guess > as you type" applicatoins). > > In relation to text fields, I know the general suggestion is gi

[GENERAL] Integer fields and auto-complete clients

2016-10-26 Thread Tim Smith
Hi, I'm curious as to what the current advice would be in relation to auto-complete type applications (e.g. "AJAX" type java-script "guess as you type" applicatoins). In relation to text fields, I know the general suggestion is gin_trgm_ops. Is there much point even thinking about using gin_trgm

Re: [GENERAL] Locking question

2016-10-26 Thread rob stone
On Wed, 2016-10-26 at 12:18 +0200, Frank Millman wrote: >   > From: hubert depesz lubaczewski > Sent: Wednesday, October 26, 2016 10:46 AM > To: Frank Millman > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Locking question >   > On Wed, Oct 26, 2016 at 10:42:29AM +0200, Frank Millman

Re: [GENERAL] Locking question

2016-10-26 Thread btober
- Original Message - > From: "Frank Millman" > To: pgsql-general@postgresql.org > Sent: Wednesday, October 26, 2016 4:42:29 AM > Subject: [GENERAL] Locking question > Hi all > I am designing an inventory application, and I want to ensure that the stock > level of any item cannot go negat

Re: [GENERAL] Master - slave replication?

2016-10-26 Thread Bjørn T Johansen
On Wed, 26 Oct 2016 13:59:02 +0200 Thomas Kellerer wrote: > Bjørn T Johansen schrieb am 26.10.2016 um 13:17: > > I have a database that I would like to replicate in case of hardware > > failure on this server. So I gather I just need a streaming replication > > (warm > > standby?) and I found a

Re: [GENERAL] Master - slave replication?

2016-10-26 Thread Thomas Kellerer
Bjørn T Johansen schrieb am 26.10.2016 um 13:17: > I have a database that I would like to replicate in case of hardware failure > on this server. So I gather I just need a streaming replication (warm > standby?) and I found a howto describing how to set it up, that looks like > this: > > 1. Edit

[GENERAL] Master - slave replication?

2016-10-26 Thread Bjørn T Johansen
I have a database that I would like to replicate in case of hardware failure on this server. So I gather I just need a streaming replication (warm standby?) and I found a howto describing how to set it up, that looks like this: Binary Replication in 7 Steps This 6-step guide, and all of the exam

Re: [GENERAL] Locking question

2016-10-26 Thread Gary Evans
Hi, Personally, I like to make the database responsible for the integrity of the data within it as much as possible. And therefore would favour Depsesz's solution to trying to manage it within the application. Cheers Gary On Wed, Oct 26, 2016 at 8:18 PM, Frank Millman wrote: > > *From:* huber

Re: [GENERAL] Locking question

2016-10-26 Thread Frank Millman
From: hubert depesz lubaczewski Sent: Wednesday, October 26, 2016 10:46 AM To: Frank Millman Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Locking question On Wed, Oct 26, 2016 at 10:42:29AM +0200, Frank Millman wrote: > Hi all > > > > I am designing an inventory application, and I

Re: [GENERAL] Locking question

2016-10-26 Thread hubert depesz lubaczewski
On Wed, Oct 26, 2016 at 10:42:29AM +0200, Frank Millman wrote: > Hi all > > I am designing an inventory application, and I want to ensure that the stock > level of any item cannot go negative. > > Instead of maintaining a running balance per item, I store the original > quantities received in o

[GENERAL] Locking question

2016-10-26 Thread Frank Millman
Hi all I am designing an inventory application, and I want to ensure that the stock level of any item cannot go negative. Instead of maintaining a running balance per item, I store the original quantities received in one table (call it ‘inv_rec’), and any amounts removed in another table (call