Re: [GENERAL] Linux replication to FreeBSD problem

2014-08-20 Thread Jov
Yes,it is locale problem. I do some more testing,and find that in my DB locale which is zh_CN.UTF-8,the indexes on FreeBSD slave can works if the indexed data is lower case ascii,it can't find data contain upper case. Explicit set the column collate to "C" can solve the problem. I will recreate al

Re: [GENERAL] Query planner question

2014-08-20 Thread David G Johnston
Soni M wrote > Hi Everyone, > > I have this query : > > select t.ticket_id , > tb.transmission_id > from ticket t, > transmission_base tb > where t.latest_transmission_id = tb.transmission_id > and t.ticket_number = tb.ticket_number > and tb.parse_date > ('2014-07-31'); > > Execution plan: http:

[GENERAL] Query planner question

2014-08-20 Thread Soni M
Hi Everyone, I have this query : select t.ticket_id , tb.transmission_id from ticket t, transmission_base tb where t.latest_transmission_id = tb.transmission_id and t.ticket_number = tb.ticket_number and tb.parse_date > ('2014-07-31'); Execution plan: http://explain.depesz.com/s/YAak Indexes on

Re: [GENERAL] POWA tool

2014-08-20 Thread Ramesh T
yes, in my postgres.conf pg_stat_statements is not their needs powa is released 19 aug. On Wed, Aug 20, 2014 at 10:17 PM, Raghu Ram wrote: > On Wed, Aug 20, 2014 at 10:08 PM, Raymond O'Donnell wrote: > >> On 20/08/2014 16:41, Ramesh T wrote: >> > Hello, >> > >> > when i ran fol

Re: [GENERAL] JsonB Gin Index is very large; is there a work around?

2014-08-20 Thread Larry White
Ok Thank you. FWIW, the documents (which I can't share) consist mainly of a long list of integers in the form {"n":"41515920318427252715"}, so they really are outliers. On Wed, Aug 20, 2014 at 5:09 PM, Peter Geoghegan < peter.geoghega...@gmail.com> wrote: > On Wed, Aug 20, 2014 at 1:53 PM, Larr

Re: [GENERAL] JsonB Gin Index is very large; is there a work around?

2014-08-20 Thread Peter Geoghegan
On Wed, Aug 20, 2014 at 1:53 PM, Larry White wrote: > Is there anyway to index a subset of the data in a JSONB column? I'm > thinking of something like declaring certain paths to be indexed? Yes. See the expression index example in the jsonb documentation. -- Regards, Peter Geoghegan -- Sen

[GENERAL] JsonB Gin Index is very large; is there a work around?

2014-08-20 Thread Larry White
Hi, I'm using 9.4 beta 2. I ran a test using 4 of the largest Json docs from our production data set. The four files total to 59.4 MB of raw json, which is compressed by TOAST to 21 MB, which is great. The index, though, is 47 MB, bringing the total size of the data in PG to 68 MB. The index was

Re: [GENERAL] POWA tool

2014-08-20 Thread Julien Rouhaud
On Wed, Aug 20, 2014 at 6:46 PM, Thomas Kellerer wrote: > Ramesh T schrieb am 20.08.2014 um 17:41: > > Hello, > > > > when i ran following query, > > postgres=# SELECT * FROM pg_stat_statements; > > > > > > ERROR: relation "pg_stat_statements" does not e

[GENERAL] Trigger to a queue for sending updates to a cache layer

2014-08-20 Thread Marcus Engene
Hi, I'm working with a retail site with tens of millions of products in several languages. For the detail pages, we try to cache in memcached. We also have quite a bit of keyword translation lookups (for international queries to solr). We're thinking of adding a nosql layer that takes the b

Re: [GENERAL] Best practices for cloning DB servers

2014-08-20 Thread Bill Mitchell
Andy - I guess that uploading your WAL to S3 at least avoids the turmoil of running your database within a VPC that would definitely be an advantage. I had imagined that replaying the WAL to get caught up from a baseline backup would be prohibitively slow versus simply snapshotting, but having t

Re: [GENERAL] POWA tool

2014-08-20 Thread Raghu Ram
On Wed, Aug 20, 2014 at 10:08 PM, Raymond O'Donnell wrote: > On 20/08/2014 16:41, Ramesh T wrote: > > Hello, > > > > when i ran following query, > > postgres=# SELECT * FROM pg_stat_statements; > > > > > > ERROR: relation "pg_stat_statements" does not ex

Re: [GENERAL] POWA tool

2014-08-20 Thread Adrian Klaver
On 08/20/2014 08:41 AM, Ramesh T wrote: Hello, when i ran following query, postgres=# SELECT * FROM pg_stat_statements; ERROR: relation "pg_stat_statements" does not exist LINE 1: SELECT * FROM pg_stat_statements; i need to install

Re: [GENERAL] POWA tool

2014-08-20 Thread Thomas Kellerer
Ramesh T schrieb am 20.08.2014 um 17:41: > Hello, > > when i ran following query, > postgres=# SELECT * FROM pg_stat_statements; > > > ERROR: relation "pg_stat_statements" does not exist > LINE 1: SELECT * FROM pg_stat_statemen

Re: [GENERAL] initial auth failure on debian

2014-08-20 Thread Adrian Klaver
On 08/20/2014 09:22 AM, TigerNassau wrote: Even with latest upgrades on debian jessie after a new postgres installation typing the following: "su - postgres" requests a password and trying several such as postgres, blank, sudo password - all gives an auth error. How can this be fixed? Here

Re: [GENERAL] POWA tool

2014-08-20 Thread Raymond O'Donnell
On 20/08/2014 16:41, Ramesh T wrote: > Hello, > > when i ran following query, > postgres=# SELECT * FROM pg_stat_statements; > > > ERROR: relation "pg_stat_statements" does not exist > LINE 1: SELECT * FROM pg_stat_statements;

[GENERAL] POWA tool

2014-08-20 Thread Ramesh T
Hello, when i ran following query, postgres=# SELECT * FROM pg_stat_statements; ERROR: relation "pg_stat_statements" does not exist LINE 1: SELECT * FROM pg_stat_statements; i need to install POWA..i got powa.zip please let me know how

Re: [GENERAL] initial auth failure on debian

2014-08-20 Thread TigerNassau
Even with latest upgrades on debian jessie after a new postgres installation typing the following: "su - postgres" requests a password and trying several such as postgres, blank, sudo password - all gives an auth error. How can this be fixed? Sent from my LG Mobile Lori Corbani wrote: >

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
It worked when I included the parameter list in the DROP statement. Thank you! Lori -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Wednesday, August 20, 2014 11:54 AM To: Lori Corbani; pgsql-general@postgresql.org Subject: Re: [GENERAL] create function :

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 08:42 AM, Lori Corbani wrote: OK...if I manually run this within psql it is fine. But I have a shell script in which I am wrapping a call to 'psql'...and I guess it does not like how things are being passed in when I do it this way. So, yes, it is working correctly when I copy/p

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
This worked! Many, many, thanks! -Original Message- From: Rob Sargent [mailto:robjsarg...@gmail.com] Sent: Wednesday, August 20, 2014 10:15 AM To: Adrian Klaver Cc: Lori Corbani; Alban Hertroys; pgsql-general@postgresql.org Subject: Re: [GENERAL] create function : change name of input pa

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
OK...if I manually run this within psql it is fine. But I have a shell script in which I am wrapping a call to 'psql'...and I guess it does not like how things are being passed in when I do it this way. So, yes, it is working correctly when I copy/paste my script directly into psql. Will try a

Re: [GENERAL] Linux replication to FreeBSD problem

2014-08-20 Thread Tom Lane
Adrian Klaver writes: > On 08/20/2014 07:53 AM, Jov wrote: >> I setup a PG 9.3.5 master on CentOS 6 x86_64,and 2 screaming replicaton >> slaves,one on CentOS6 x86_64,the other on FreeBSD 10 amd64. >> The replication work fine for a week,But today I find a problem on sql >> running on FreeBSD:simpl

Re: [GENERAL] Linux replication to FreeBSD problem

2014-08-20 Thread Adrian Klaver
On 08/20/2014 07:53 AM, Jov wrote: I setup a PG 9.3.5 master on CentOS 6 x86_64,and 2 screaming replicaton slaves,one on CentOS6 x86_64,the other on FreeBSD 10 amd64. The replication work fine for a week,But today I find a problem on sql running on FreeBSD:simple sql use index do not return resul

[GENERAL] Linux replication to FreeBSD problem

2014-08-20 Thread Jov
I setup a PG 9.3.5 master on CentOS 6 x86_64,and 2 screaming replicaton slaves,one on CentOS6 x86_64,the other on FreeBSD 10 amd64. The replication work fine for a week,But today I find a problem on sql running on FreeBSD:simple sql use index do not return result.If I disable the index ,use seqscan

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Tom Lane
Lori Corbani writes: > My example: > DROP FUNCTION ACC_setMax(); > CREATE OR REPLACE FUNCTION ACC_setMax ( > increment int, > prefixPart varchar(30) = 'MGI:' > ) > RETURNS VOID AS > \$\$ This is not the right thing: you need to include the parameters in the drop command. ACC_setMax() is a tota

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 07:00 AM, Lori Corbani wrote: My example: DROP FUNCTION ACC_setMax(); CREATE OR REPLACE FUNCTION ACC_setMax ( increment int, prefixPart varchar(30) = 'MGI:' ) RETURNS VOID AS \$\$ BEGIN /* Increment the max MGI Accession Number by @increment */ update ACC_AccessionMax set maxN

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 07:00 AM, Lori Corbani wrote: My example: DROP FUNCTION ACC_setMax(); CREATE OR REPLACE FUNCTION ACC_setMax ( increment int, prefixPart varchar(30) = 'MGI:' ) RETURNS VOID AS \$\$ BEGIN /* Increment the max MGI Accession Number by @increment */ update ACC_AccessionMax set maxN

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Rob Sargent
Include the types in the drop Sent from my iPhone > On Aug 20, 2014, at 7:59 AM, Adrian Klaver wrote: > >> On 08/20/2014 06:51 AM, Lori Corbani wrote: >> >> I *am* definitely dropping the function first. I still get the same error. > > Well we need to see the actual sequence to figure this

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 06:51 AM, Lori Corbani wrote: I *am* definitely dropping the function first. I still get the same error. Well we need to see the actual sequence to figure this out. Best guess, is you have more than one function with that name. -- Adrian Klaver adrian.kla...@aklaver.com

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
My example: DROP FUNCTION ACC_setMax(); CREATE OR REPLACE FUNCTION ACC_setMax ( increment int, prefixPart varchar(30) = 'MGI:' ) RETURNS VOID AS \$\$ BEGIN /* Increment the max MGI Accession Number by @increment */ update ACC_AccessionMax set maxNumericPart = maxNumericPart + increment where

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
I *am* definitely dropping the function first. I still get the same error. -Original Message- From: Alban Hertroys [mailto:haram...@gmail.com] Sent: Wednesday, August 20, 2014 9:44 AM To: Lori Corbani Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] create function : change name

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
Yes, I am doing a DROP and then a CREATE OR REPLACE Let me read over your example... -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Wednesday, August 20, 2014 9:40 AM To: Lori Corbani; pgsql-general@postgresql.org Subject: Re: [GENERAL] create function :

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Alban Hertroys
On 20 August 2014 15:25, Lori Corbani wrote: > The ‘create function’ documentation states: > > ‘You cannot change the name already assigned to any input parameter > (although you can add names to parameters that had none before).’ Further on in that same paragraph (although I looked at the 9.3 d

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 06:25 AM, Lori Corbani wrote: Using Postgres Version 9.0.4: We are migrating our Sybase stored procedures to Postgres and need to be able to drop/replace the SPs, making needed changes to input parameters to fix issues/differences between Sybase and Postgres. However, we keep gett

[GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
Using Postgres Version 9.0.4: We are migrating our Sybase stored procedures to Postgres and need to be able to drop/replace the SPs, making needed changes to input parameters to fix issues/differences between Sybase and Postgres. However, we keep getting this error when we drop/replace the PG/

Re: [GENERAL] pg_advisory_lock problem

2014-08-20 Thread Rémi Cura
Hey, just a quick follow-up for archive: problem solved with pg_try_advisory... using lock (ROW EXCLUSIVE) does'nt work (same duplicate key value) using lock (ACCESS EXCLUSIVE) work (no error) but stop the parallelism (one thread as to wait for another to go on). The optimal solution would be to