Re: [GENERAL] Push predicate down in view containing window function

2013-11-14 Thread Philippe Girolami
Ok so is there a way i can do something similar ? Would a function returning rows and taking the extra predicate 'values' as parameters be as optimized as the 'good' query in my first email ? Thanks. Tom Lane a écrit : Philippe Girolami writes: > Hello, > Using postgres 9.1.9, I have a view

Re: [GENERAL] pg_trgm module: no convertion into Trigrams on one side when comparing

2013-11-14 Thread Amit Langote
On Thu, Nov 14, 2013 at 9:05 PM, Janek Sendrowski wrote: > Hi Amit, > > Thanks for your answer. > > My issue is that I still need a ranking like the similarity when comparing > trigrams. > I'm working on a similarity search, which determindes similiar sentences from > my table. > > The usual sim

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Michael Paquier
On Thu, Nov 14, 2013 at 10:44 PM, Alexander Farber wrote: > sysctl.conf: > >kernel.shmmax=17179869184 >kernel.shmall=4194304 You do not need those settings in sysctl.conf since 9.3 as consumption of V shared memory has been reduced with this commit: http://git.postgresql.org/gitweb/?p=post

Re: [GENERAL] Push predicate down in view containing window function

2013-11-14 Thread Tom Lane
Philippe Girolami writes: > Hello, > Using postgres 9.1.9, I have a view that uses a window function. I then query > that view with a predicate on one of the columns. Unfortunately, the > predicate doesn't get pushed down into the view. > Given that the predicate applies to a column that's being

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Dang Minh Huong
Thank you all for your support. 2013/11/15 3:40、Sergey Konoplev のメッセージ: >> On Thu, Nov 14, 2013 at 7:13 AM, Dang Minh Huong wrote: >> I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL >> clause. >> Is there any equivalent syntax in PL/pgSQL to solve it. >> >> --

[GENERAL] Push predicate down in view containing window function

2013-11-14 Thread Philippe Girolami
Hello, Using postgres 9.1.9, I have a view that uses a window function. I then query that view with a predicate on one of the columns. Unfortunately, the predicate doesn't get pushed down into the view. Given that the predicate applies to a column that's being partitionned on, why wouldn't the o

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Tomas Vondra
On 14 Listopad 2013, 16:09, Alexander Farber wrote: > pgtune has produced the following for my server (the specs: > http://www.hetzner.de/en/hosting/produkte_rootserver/px60ssd ): > > default_statistics_target = 50 > maintenance_work_mem = 1GB > constraint_exclusion = on > checkpoint_completion_tar

Re: [GENERAL] Clone database using rsync?

2013-11-14 Thread Laurentius Purba
Just want to give you some idea for your reference. If you are using zfs, you will be gaining lots of advantages. A simple clone and send command from zfs will help you big time. Check it out: http://docs.oracle.com/cd/E18752_01/html/819-5461/docinfo.html On Tue, Nov 5, 2013 at 6:11 PM, sparikh

[GENERAL] PostgreSQL now on Amazon RDS

2013-11-14 Thread Helio Campos Mello de Andrade
Guys, - Now Amazon offers PostgreSQL as an RDS option. See on http://aws.amazon.com/en/rds/postgresql/ Regards, Helio Campos Mello de Andrade

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Sergey Konoplev
On Thu, Nov 14, 2013 at 7:13 AM, Dang Minh Huong wrote: > I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL > clause. > Is there any equivalent syntax in PL/pgSQL to solve it. > > -- > rec typ[]; > (typ[1]).t1 := 1; > -- You can easily make different tricks wit

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Sergey Konoplev
On Thu, Nov 14, 2013 at 5:44 AM, Alexander Farber wrote: > sysctl.conf: > >kernel.shmmax=17179869184 >kernel.shmall=4194304 You can also consult this document about kernel and OS settings: https://github.com/grayhemp/pgcookbook/blob/master/database_server_configuration.md -- Kind regar

Re: [GENERAL] Mixed locales and date formatting

2013-11-14 Thread Adrian Klaver
On 11/14/2013 08:19 AM, Vincent Veyron wrote: Hi List, Using databases with different locales on the same cluster, I am trying to have Postgresql display the date in the locale format of each database. I found the TM prefix : http://www.postgresql.org/docs/8.4/static/functions-formatting.html#F

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Zev Benjamin
On 11/14/2013 10:09 AM, Alexander Farber wrote: pgtune has produced the following for my server (the specs: http://www.hetzner.de/en/hosting/produkte_rootserver/px60ssd ): default_statistics_target = 50 maintenance_work_mem = 1GB constraint_exclusion = on checkpoint_completion_target = 0.9 effec

[GENERAL] Mixed locales and date formatting

2013-11-14 Thread Vincent Veyron
Hi List, Using databases with different locales on the same cluster, I am trying to have Postgresql display the date in the locale format of each database. I found the TM prefix : http://www.postgresql.org/docs/8.4/static/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIMEMOD-TABLE However,

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Elliot
On 2013-11-14 10:56, Dang Minh Huong wrote: > Hi, > > 2013/11/15 0:38、Elliot のメッセージ: > >>> On 2013-11-14 10:32, Dang Minh Huong wrote: >>> Hi, >>> >>> 2013/11/15 0:20、Elliot のメッセージ: >>> > On 2013-11-14 10:13, Dang Minh Huong wrote: > Hi all, > > I am using PostgreSQL 9.1 and get a

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Dang Minh Huong
Hi, 2013/11/15 0:43、David Johnston のメッセージ: > bocap wrote (rec[1]).t1 := 1; > > You need to stay one-level higher and re-build the entire typ entry then > assign it back to the array at the same position. > > rec[1] = (1, rec[1].t2)::typ; > Thanks. I think, i can solve it with this way.

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Dang Minh Huong
Hi, 2013/11/15 0:38、Elliot のメッセージ: >> On 2013-11-14 10:32, Dang Minh Huong wrote: >> Hi, >> >> 2013/11/15 0:20、Elliot のメッセージ: >> On 2013-11-14 10:13, Dang Minh Huong wrote: Hi all, I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL clause.

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread David Johnston
bocap wrote >>> (rec[1]).t1 := 1; You need to stay one-level higher and re-build the entire typ entry then assign it back to the array at the same position. rec[1] = (1, rec[1].t2)::typ; David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Equivalent-syntax-of-P

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Elliot
On 2013-11-14 10:32, Dang Minh Huong wrote: > Hi, > > 2013/11/15 0:20、Elliot のメッセージ: > >>> On 2013-11-14 10:13, Dang Minh Huong wrote: >>> Hi all, >>> >>> I am using PostgreSQL 9.1 and get a syntax error with the following >>> PL/pgSQL clause. >>> Is there any equivalent syntax in PL/pgSQL to sol

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Dang Minh Huong
Hi, 2013/11/15 0:20、Elliot のメッセージ: >> On 2013-11-14 10:13, Dang Minh Huong wrote: >> Hi all, >> >> I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL >> clause. >> Is there any equivalent syntax in PL/pgSQL to solve it. >> >> -- >> rec typ[]; >> (typ[1]).t1 := 1;

Re: [GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Elliot
On 2013-11-14 10:13, Dang Minh Huong wrote: Hi all, I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL clause. Is there any equivalent syntax in PL/pgSQL to solve it. -- rec typ[]; (typ[1]).t1 := 1; -- typ is type which was created by command below. Create t

[GENERAL] Equivalent syntax of PL/SQL using array in PL/pgSQL

2013-11-14 Thread Dang Minh Huong
Hi all, I am using PostgreSQL 9.1 and get a syntax error with the following PL/pgSQL clause. Is there any equivalent syntax in PL/pgSQL to solve it. -- rec typ[]; (typ[1]).t1 := 1; -- typ is type which was created by command below. Create type typ as( t1 interger, t2 text); I am migra

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Alexander Farber
pgtune has produced the following for my server (the specs: http://www.hetzner.de/en/hosting/produkte_rootserver/px60ssd ): default_statistics_target = 50 maintenance_work_mem = 1GB constraint_exclusion = on checkpoint_completion_target = 0.9 effective_cache_size = 22GB work_mem = 192MB wal_buffer

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Alexander Farber
And pgtune is 4 years old...

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Alexander Farber
Hello, my problem with http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server is that it never mentions larger amounts of RAM, so while reading it I always wonder how up-to-date it is...

Re: [GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Jayadevan M
Hi, On Thu, Nov 14, 2013 at 7:14 PM, Alexander Farber < alexander.far...@gmail.com> wrote: > Hello, > > do these changes please look okay for a PostgreSQL 9.3 running on CentOS > 6.4 server with 32 GB RAM (with Drupal 7 and few custom PHP scripts) > > postgresql.conf: > >shared_buffers = 4096

[GENERAL] Tuning 9.3 for 32 GB RAM

2013-11-14 Thread Alexander Farber
Hello, do these changes please look okay for a PostgreSQL 9.3 running on CentOS 6.4 server with 32 GB RAM (with Drupal 7 and few custom PHP scripts) postgresql.conf: shared_buffers = 4096MB work_mem = 32MB checkpoint_segments = 32 log_min_duration_statement = 1 sysctl.conf:

Re: [GENERAL] pg_trgm module: no convertion into Trigrams on one side when comparing

2013-11-14 Thread Janek Sendrowski
Hi Amit,   Thanks for your answer. My issue is that I still need a ranking like the similarity when comparing trigrams. I'm working on a similarity search, which determindes similiar sentences from my table. The usual similarity search with Trigrams and a gist bzw. gin index is to slow with my

Re: [GENERAL] expression index not used within function

2013-11-14 Thread LPlateAndy
Thanks Tom. I'll try the "EXECUTE" method as well but my dev environment is 9.2 and the planner doesn't seem to be including the index so following are the fairly basic table/index/function details. Thanks, Andy: TABLE (circa 300,000 rows): ===

Re: [GENERAL] expression index not used within function

2013-11-14 Thread LPlateAndy
Hi David, Thanks, i can see the logic there. To place a constant in front, i tried putting 'pc'||pcode in to the index and 'pc'||$1 in to the WHERE clause. It had no effect - does the planner see this as a cheat and i need to actually prefix the data in the tables? Andy -- View this message

[GENERAL] Re: How to print out a mass of text messages from a Samsung smart phone easily?

2013-11-14 Thread walerina
Very helpful, thanks! And here i'd like to share other method, that is, iPubsoft Android Desktop Manager, which is very helpful on solving this kind of things! For example, you can get a guide from here: How to Print Text Messages from Samsung Phones