Re: [GENERAL] Partitioned postgres tables don't need update trigger??

2016-06-03 Thread rverghese
Perfect! Thanks for the response! Just wanted to make sure I wasn't missing anything. -- View this message in context: http://postgresql.nabble.com/Partitioned-postgres-tables-don-t-need-update-trigger-tp5906403p5906415.html Sent from the PostgreSQL - general mailing list archive at

Re: [GENERAL] Partitioned postgres tables don't need update trigger??

2016-06-03 Thread David G. Johnston
On Fri, Jun 3, 2016 at 5:03 PM, rverghese wrote: > I am working with partitioned tables. I have partitioned based on date and > I have the INSERT trigger in place, I don't have an Update or Delete > Trigger but both updates and deletes against the master table work >

[GENERAL] Partitioned postgres tables don't need update trigger??

2016-06-03 Thread rverghese
I am working with partitioned tables. I have partitioned based on date and I have the INSERT trigger in place, I don't have an Update or Delete Trigger but both updates and deletes against the master table work correctly. I am not sure how these are working without triggers. Any insight? So, this

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Jeff Janes
On Fri, Jun 3, 2016 at 1:02 PM, Tom Lane wrote: > Jeff Janes writes: >> On Fri, Jun 3, 2016 at 12:13 PM, Greg Navis wrote: >>> I'm curious ... would it be difficult to modify PostgreSQL so that it'd use >>> the index for

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Tom Lane
Jeff Janes writes: > On Fri, Jun 3, 2016 at 12:13 PM, Greg Navis wrote: >> I'm curious ... would it be difficult to modify PostgreSQL so that it'd use >> the index for `similarity(lhs, rhs) >= show_limit()` too? > Yes, that would be very difficult.

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread David G. Johnston
On Fri, Jun 3, 2016 at 3:27 PM, Jeff Janes wrote: > On Fri, Jun 3, 2016 at 12:13 PM, Greg Navis wrote: > > Thanks for answers and sorry for not searching hard enough. > > > > I'm curious ... would it be difficult to modify PostgreSQL so that it'd >

Re: [GENERAL] Londiste3 - Ubuntu 16.04 - Postgresql 9.3

2016-06-03 Thread Leonardo M . Ramé
El 03/06/16 a las 16:29, Adrian Klaver escribió: On 06/03/2016 12:08 PM, Leonardo M. Ramé wrote: Hi again, I'm trying to create the root node using londiste3 from Ubuntu 16.04 connected to a PostgreSql 9.3 db, but I get this: londiste3 /home/leonardo/replication/pacsio_master.ini create-root

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-03 Thread David G. Johnston
On Thu, Jun 2, 2016 at 11:59 PM, Patrick Baker wrote: > > > 2016-06-03 15:50 GMT+12:00 David G. Johnston : > >> On Thu, Jun 2, 2016 at 11:37 PM, Patrick Baker >> wrote: >> >>> >>> How can I make the function to gets

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-03 Thread David G. Johnston
On Fri, Jun 3, 2016 at 3:16 PM, Adrian Klaver wrote: > On 06/03/2016 12:23 AM, Patrick Baker wrote: > >> >> >> -- Creating the backup table with the essential data >> INSERT INTO table2 (row.note_id, row.size, row.file_id, row.full_path) >> >> . >> >>

Re: [GENERAL] Londiste3 - Ubuntu 16.04 - Postgresql 9.3

2016-06-03 Thread Adrian Klaver
On 06/03/2016 12:08 PM, Leonardo M. Ramé wrote: Hi again, I'm trying to create the root node using londiste3 from Ubuntu 16.04 connected to a PostgreSql 9.3 db, but I get this: londiste3 /home/leonardo/replication/pacsio_master.ini create-root master_node "dbname=test host=127.0.0.1"

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Jeff Janes
On Fri, Jun 3, 2016 at 12:13 PM, Greg Navis wrote: > Thanks for answers and sorry for not searching hard enough. > > I'm curious ... would it be difficult to modify PostgreSQL so that it'd use > the index for `similarity(lhs, rhs) >= show_limit()` too? Yes, that would be

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread David G. Johnston
On Fri, Jun 3, 2016 at 3:13 PM, Greg Navis wrote: > Thanks for answers and sorry for not searching hard enough. > > I'm curious ... would it be difficult to modify PostgreSQL so that it'd > use the index for `similarity(lhs, rhs) >= show_limit()` too? > ​Not in a way that

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-03 Thread Adrian Klaver
On 06/03/2016 12:23 AM, Patrick Baker wrote: -- Creating the backup table with the essential data INSERT INTO table2 (row.note_id, row.size, row.file_id, row.full_path) . Still not seeing what the JOIN to table3 t3 gets you? Any way the function works. I changed

Re: [GENERAL] Londiste3 - Ubuntu 16.04 - Postgresql 9.3

2016-06-03 Thread Leonardo M . Ramé
El 03/06/16 a las 16:08, Leonardo M. Ramé escribió: Hi again, I'm trying to create the root node using londiste3 from Ubuntu 16.04 connected to a PostgreSql 9.3 db, but I get this: londiste3 /home/leonardo/replication/pacsio_master.ini create-root master_node "dbname=test host=127.0.0.1"

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Greg Navis
Thanks for answers and sorry for not searching hard enough. I'm curious ... would it be difficult to modify PostgreSQL so that it'd use the index for `similarity(lhs, rhs) >= show_limit()` too? Or even add `is_similar(lhs, rhs, threshold)` that'd allow to change the threshold on a per-query

[GENERAL] Londiste3 - Ubuntu 16.04 - Postgresql 9.3

2016-06-03 Thread Leonardo M . Ramé
Hi again, I'm trying to create the root node using londiste3 from Ubuntu 16.04 connected to a PostgreSql 9.3 db, but I get this: londiste3 /home/leonardo/replication/pacsio_master.ini create-root master_node "dbname=test host=127.0.0.1" 2016-06-03 16:03:39,257 27600 INFO plpgsql is

Re: [GENERAL] [HACKERS] Change in order of criteria - reg

2016-06-03 Thread David G. Johnston
On Wed, Jun 1, 2016 at 12:07 AM, sri harsha wrote: > > Hi, > > In PostgreSQL , does the order in which the criteria is given matter > ?? For example > > Query 1 : Select * from TABLE where a > 5 and b < 10; > > Query 2 : Select * from TABLE where b <10 and a > 5; > >

Re: [GENERAL] [HACKERS] Change in order of criteria - reg

2016-06-03 Thread Robert Haas
On Wed, Jun 1, 2016 at 5:22 AM, Amit Langote wrote: > On 2016/06/01 13:07, sri harsha wrote: >> Hi, >> >> In PostgreSQL , does the order in which the criteria is given matter ?? >> For example >> >> Query 1 : Select * from TABLE where a > 5 and b < 10; >> >>

Re: [GENERAL] pgFoundry down

2016-06-03 Thread Leonardo M . Ramé
El 03/06/16 a las 14:10, Adrian Klaver escribió: On 06/03/2016 08:42 AM, Leonardo M. Ramé wrote: Hi, I'm trying to download Skytools 3.2 but pgFoundry seems to be down, does anyone know another place to download it?. I just tried it and got through: http://pgfoundry.org/projects/skytools/

Re: [GENERAL] pgFoundry down

2016-06-03 Thread Adrian Klaver
On 06/03/2016 08:42 AM, Leonardo M. Ramé wrote: Hi, I'm trying to download Skytools 3.2 but pgFoundry seems to be down, does anyone know another place to download it?. I just tried it and got through: http://pgfoundry.org/projects/skytools/ Regards, -- Adrian Klaver

[GENERAL] pgFoundry down

2016-06-03 Thread Leonardo M . Ramé
Hi, I'm trying to download Skytools 3.2 but pgFoundry seems to be down, does anyone know another place to download it?. Regards, -- Leonardo M. Ramé Medical IT - Griensu S.A. Av. Colón 636 - Piso 8 Of. A X5000EPT -- Córdoba Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19 Cel.: +54

Re: [GENERAL] psql remote shell command

2016-06-03 Thread Merlin Moncure
On Thu, Jun 2, 2016 at 6:54 PM, Michael Paquier wrote: > On Fri, Jun 3, 2016 at 8:48 AM, David G. Johnston > wrote: >> On Thu, Jun 2, 2016 at 7:39 PM, Michael Paquier >> wrote: >> I was focused on admin task due

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread David G. Johnston
On Friday, June 3, 2016, Greg Navis wrote: > Hey! > > I'm playing with pg_trgm. It seems that `lhs % rhs` is _almost_ equivalent > to `similarity(lhs, rhs) < show_limit()`. The difference that I noticed is > that `%` uses a GIN index while `similarity` does not. > > ``` >

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Artur Zakirov
Oh, I understand. It is because you want different limits for restaurants and cinemas? I see only one solution. It is custom extension, which will create operator class similar to gin_trgm_ops and will depends on pg_trgm. In gin_trgm_consistent() you can use your own limit variable. As I

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Greg Navis
Artur, thanks for your reply. That's right, `%` does use the index. The goal of using `similarity(lhs, rhs) >= show_limit()` was to replace `show_limit()` with a custom, per-query limit. I noticed that the latter approach does _not_ use the index, hence my question: grn=# EXPLAIN ANALYZE SELECT *

Re: [GENERAL] [pg_trgm] Per-query set_limit()

2016-06-03 Thread Artur Zakirov
Unfortunately, there is not a better way. You should manually set it if you want different limit. On 03.06.2016 13:43, Greg Navis wrote: Hey! I'd like to call `set_limit` on a per-query basis, i.e. searching for restaurants in a given city should use 0.4 and searching for cinemas by name

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Artur Zakirov
Hello. As I know 'lhs % rhs' is equivalent to 'similarity(lhs, rhs) >= show_limit()'. And so your query should looks like this: SELECT * FROM restaurants WHERE city % 'warsw'; And it should use index. On 03.06.2016 13:35, Greg Navis wrote: Hey! I'm playing with pg_trgm. It seems that

[GENERAL] [pg_trgm] Per-query set_limit()

2016-06-03 Thread Greg Navis
Hey! I'd like to call `set_limit` on a per-query basis, i.e. searching for restaurants in a given city should use 0.4 and searching for cinemas by name should use 0.2. I can accomplish this with: ``` SELECT set_limit(0.2); SELECT * FROM cinemas WHERE name % ?; ``` (similarly for restaurants).

[GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Greg Navis
Hey! I'm playing with pg_trgm. It seems that `lhs % rhs` is _almost_ equivalent to `similarity(lhs, rhs) < show_limit()`. The difference that I noticed is that `%` uses a GIN index while `similarity` does not. ``` grn=# \d restaurants Table "public.restaurants" Column | Type

Re: [GENERAL] Slave claims requested WAL segment already removed - but it wasn't

2016-06-03 Thread Nick Cleaton
On 2 June 2016 at 02:43, Jeff Beck wrote: > Hi- > We have a master (pg 9.4.4 on Ubuntu 14.10) and a slave (pg 9.4.8 on > Centos 7). During a period of heavy use, the slave began complaining > that the “requested WAL segment xx has already been removed”. But > the WAL

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-03 Thread Patrick Baker
> > > > -- Creating the backup table with the essential data > INSERT INTO table2 (row.note_id, row.size, row.file_id, row.full_path) > > . > > Still not seeing what the JOIN to table3 t3 gets you? > > Any way the function works. > > I changed the function to use row.note_id, row.size, etc...