Re: [GENERAL] Lock Management: Waiting on locks

2014-11-25 Thread Bill Moran
On Wed, 26 Nov 2014 02:37:51 +0530 Dev Kumkar wrote: > Am debugging a race condition scenario where multiple transaction are > running in parallel and there are insert/update these transactions are > performing. > > I was able to identify the blocking query and blocked query using following > SQ

Re: [GENERAL] is there a warm standby sync trigger?

2014-11-25 Thread Sameer Kumar
On Fri, Oct 24, 2014 at 8:01 PM, Michael Paquier wrote: > On Fri, Oct 24, 2014 at 12:30 AM, John Smith > wrote: > > > > i want to setup a warm standby that listens 24/7 but only syncs when > > told to (ie only when i am ok with the database updates, will i > > trigger the sync). > > can i? > > >

Re: [GENERAL] Estimating WAL usage during pg_basebackup

2014-11-25 Thread Sameer Kumar
On Fri, Oct 31, 2014 at 2:52 AM, Mike Blackwell wrote: > I need to get an idea of how much WAL space will be required during a long > (many hours) pg_basebackup over a relatively slow network connection. This > is for a server that's not yet running PITR / streaming. > > Any thoughts? > ​You ma

Re: [GENERAL] Avoiding deadlocks when performing bulk update and delete operations

2014-11-25 Thread Bill Moran
On Wed, 26 Nov 2014 10:41:56 +1100 Sanjaya Vithanagama wrote: > > > * How frequently do deadlocks occur? > > We are seeing deadlocks about 2-3 times per day in the production server. > To reproduce the problem easily we've written a simple Java class with > multiple threads calling to the stored

Re: [GENERAL] Avoiding deadlocks when performing bulk update and delete operations

2014-11-25 Thread Sanjaya Vithanagama
On Tue, Nov 25, 2014 at 4:42 AM, Bill Moran wrote: > On Mon, 24 Nov 2014 14:51:42 +1100 > Sanjaya Vithanagama wrote: > > > Hi All, > > > > We have a single table which does not have any foreign key references. > > > > id_A (bigint) > > id_B (bigint) > > val_1 (varchar) > > val_2 (varchar) > > >

Re: [GENERAL] SQL functions and triggers?

2014-11-25 Thread Alban Hertroys
> On 25 Nov 2014, at 22:24, Tom Lane wrote: > > Alban Hertroys writes: >> In the past, when writing trigger functions, I’ve always used pl/pgsql >> without giving it a second thought. Today I was modifying a database >> creation script that was originally intended for Firebird to work with >

Re: [GENERAL] returning only part of a rule set

2014-11-25 Thread Dave Potts
On 25/11/14 22:24, David G Johnston wrote: Thanks List, I think this is the right way to go. Adrian Klaver-4 wrote If I am only interested in get 2 entries per result set, I would expect to see Actually <=2. How do you determine which rows to keep, by id or something else? 1 xx,yy 2 xx,yy

Re: [GENERAL] returning only part of a rule set

2014-11-25 Thread David G Johnston
Adrian Klaver-4 wrote >> >> If I am only interested in get 2 entries per result set, I would expect >> to see > > Actually <=2. > How do you determine which rows to keep, by id or something else? > >> >> 1 xx,yy >> 2 xx,yy >> >> >> 1,dd,zz >> 2,dd,zz >> >> 1, ee,ff >> >> Using LIMIT only gives >

Re: [GENERAL] returning only part of a rule set

2014-11-25 Thread Adrian Klaver
On 11/25/2014 01:56 PM, Dave Potts wrote: On 25/11/14 21:36, Adrian Klaver wrote: On 11/25/2014 01:27 PM, Dave Potts wrote: I have a psql function that make a general sql query, returns a set of results Q. Is there anyway that I can limit the size of the result sets ? Put a LIMIT on the qu

Re: [GENERAL] returning only part of a rule set

2014-11-25 Thread Dave Potts
On 25/11/14 21:36, Adrian Klaver wrote: On 11/25/2014 01:27 PM, Dave Potts wrote: I have a psql function that make a general sql query, returns a set of results Q. Is there anyway that I can limit the size of the result sets ? Put a LIMIT on the query. If that is not what you want then we

Re: [GENERAL] returning only part of a rule set

2014-11-25 Thread Adrian Klaver
On 11/25/2014 01:27 PM, Dave Potts wrote: I have a psql function that make a general sql query, returns a set of results Q. Is there anyway that I can limit the size of the result sets ? Put a LIMIT on the query. If that is not what you want then we will need to see the code and/or get a m

Re: [GENERAL] returning only part of a rule set

2014-11-25 Thread David G Johnston
Dave Potts wrote > I have a psql function that make a general sql query, returns a set of > results > Q. Is there anyway that I can limit the size of the result sets ? SELECT * FROM somewhere LIMIT 50; <--- David J. btw: what is a "psql function"? -- View this message in context: http://

[GENERAL] returning only part of a rule set

2014-11-25 Thread Dave Potts
I have a psql function that make a general sql query, returns a set of results Q. Is there anyway that I can limit the size of the result sets ? Dave. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/m

Re: [GENERAL] SQL functions and triggers?

2014-11-25 Thread Tom Lane
Alban Hertroys writes: > In the past, when writing trigger functions, I’ve always used pl/pgsql > without giving it a second thought. Today I was modifying a database creation > script that was originally intended for Firebird to work with Postgres and > the example trigger procedures in ther

Re: [GENERAL] Best filesystem for a high load db

2014-11-25 Thread Andy Colson
On 11/25/2014 9:43 AM, Maila Fatticcioni wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I need to install a Postgresql 9.4 cluster with two servers at first instance. The database will be used in an enviroment with high load, a lot number of clients will do queries that require fast

[GENERAL] Lock Management: Waiting on locks

2014-11-25 Thread Dev Kumkar
Am debugging a race condition scenario where multiple transaction are running in parallel and there are insert/update these transactions are performing. I was able to identify the blocking query and blocked query using following SQL. However observed the blocking query is holding the locks on the

Re: [GENERAL] SQL functions and triggers?

2014-11-25 Thread Bill Moran
On Tue, 25 Nov 2014 21:41:12 +0100 Alban Hertroys wrote: > Hi all, > > In the past, when writing trigger functions, I?ve always used pl/pgsql > without giving it a second thought. Today I was modifying a database creation > script that was originally intended for Firebird to work with Postgres

Re: [GENERAL] Transactions to create pg_multixact members and offsets

2014-11-25 Thread Dev Kumkar
On Fri, Nov 21, 2014 at 1:14 AM, Alvaro Herrera wrote: > > If there are foreign keys on the tables, the system internally runs some > SELECT FOR KEY SHARE queries on the referenced tables (the ones > containing the primary or unique keys). You can get some multixacts > that way too. > > -- > Álv

[GENERAL] SQL functions and triggers?

2014-11-25 Thread Alban Hertroys
Hi all, In the past, when writing trigger functions, I’ve always used pl/pgsql without giving it a second thought. Today I was modifying a database creation script that was originally intended for Firebird to work with Postgres and the example trigger procedures in there were very close to pure

[GENERAL] users per database

2014-11-25 Thread Willy-Bas Loos
Hi, I'm moving a database out of an existing cluster, and was wondering which users i need to take with it. So i made 2 little queries that show the users that have rights in the database, maybe they wil come in handy for someone else too. --show owners of objects in this database select pg_get_u

Re: [GENERAL] Best filesystem for a high load db

2014-11-25 Thread Bill Moran
On Tue, 25 Nov 2014 17:27:18 +0100 Christoph Berg wrote: > Re: Bill Moran 2014-11-25 > <20141125111630.d05d58a9eb083c7cf80ed...@potentialtech.com> > > Anything with a journal is a performance problem. PostgreSQL effectivly > > does its own journalling with the WAL logs. That's not to say that th

Re: [GENERAL] Best filesystem for a high load db

2014-11-25 Thread Christoph Berg
Re: Bill Moran 2014-11-25 <20141125111630.d05d58a9eb083c7cf80ed...@potentialtech.com> > Anything with a journal is a performance problem. PostgreSQL effectivly > does its own journalling with the WAL logs. That's not to say that there's > no value to crash recovery to having a journalling filesyst

Re: [GENERAL] Best filesystem for a high load db

2014-11-25 Thread Bill Moran
On Tue, 25 Nov 2014 16:43:49 +0100 Maila Fatticcioni wrote: > Hello, > I need to install a Postgresql 9.4 cluster with two servers at first > instance. The database will be used in an enviroment with high load, a > lot number of clients will do queries that require fast replies. > I have to instal

[GENERAL] Best filesystem for a high load db

2014-11-25 Thread Maila Fatticcioni
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I need to install a Postgresql 9.4 cluster with two servers at first instance. The database will be used in an enviroment with high load, a lot number of clients will do queries that require fast replies. I have to install Ubuntu 14.04 as OS and

[GENERAL] Serialization exception : Who else was involved?

2014-11-25 Thread Olivier MATROT
I'm using PostgreSQL 9.2.8 on Windows x64. When a transaction as SERIALIZABLE isolation level is failing, is there a way to know which connection(s), thus transaction(s), were involved in the overall process ? I'm working on an accounting database. I know that we should retry the transactio