Re: using a function in where

2018-12-03 Thread Alban Hertroys
> On 3 Dec 2018, at 8:06, Glenn Schultz wrote: > > All, > I am using the function below to convert a continuous variable to a binned > value. Sometimes a value other than zero is passed through the query. For > example -.5 result value is passed to the query result. The basic of the > quer

Re: postgis after pg_upgrade

2018-12-03 Thread Rene Romero Benavides
Are the postgis functions usable? do they currently work ? any error messages in the database server logs ? have you installed the postgis binaries for postgres 9.6? if you follow the given advise by Paul Ramsey, what happens? Am So., 2. Dez. 2018 um 14:24 Uhr schrieb Slavcho Trnkovski < strnkov..

Re: postgis after pg_upgrade

2018-12-03 Thread Adrian Klaver
On 12/1/18 8:56 AM, Slavcho Trnkovski wrote: Hi, This will not resolve the issue I have because extension is already to the latest version, but it is using postgres 9.4 and it should use 9.6. Well according to below: POSTGIS="2.4.5 r16765" According to this: http://postgis.net/source/ pos

Re: How to watch for schema changes

2018-12-03 Thread Adrian Klaver
On 12/2/18 5:24 AM, Igor Korot wrote: Hi, Adrian, Sorry for the delay to come back to this. I was busy doing other things. On Tue, Jul 3, 2018 at 12:32 PM Adrian Klaver wrote: On 07/03/2018 10:21 AM, Igor Korot wrote: Hi, ALL, Is there any trigger or some other means I can do on the server w

GiST index on INT8, possible bug in query planner?

2018-12-03 Thread Jan Behrens
Dear colleagues, I have developed two indices using PostgreSQL's awesome GiST support, one of them available here: http://www.public-software-group.org/pgLatLon (which is a lightweight and MIT-licensed alternative to PostGIS for certain simple tasks involving geographic coordinates on the WGS-84

Re: How to watch for schema changes

2018-12-03 Thread Igor Korot
Hi, Adrian, On Mon, Dec 3, 2018 at 9:17 AM Adrian Klaver wrote: > > On 12/2/18 5:24 AM, Igor Korot wrote: > > Hi, Adrian, > > Sorry for the delay to come back to this. I was busy doing other things. > > > > On Tue, Jul 3, 2018 at 12:32 PM Adrian Klaver > > wrote: > >> > >> On 07/03/2018 10:21 A

Query never completes with an OR condition

2018-12-03 Thread Kenneth Marshall
Hi, I was investigating a performance problem and found a query that never completes in a reasonable amount of time even though my expectation is that it should. I am running version 9.6.6. I do not see anything in the 9.6.* release notes that mention this problem. The individual queries run as ex

Re: GiST index on INT8, possible bug in query planner?

2018-12-03 Thread Tom Lane
Jan Behrens writes: > However, the GiST index seems not to work as expected by me when > 64-bit integers are involved. I tried to create a minimal > proof-of-concept to demonstrate this. Consider the following setup: > CREATE TABLE test8_gist (id SERIAL4, ctx INT8); > CREATE INDEX ON test8_gist US

Re: GiST index on INT8, possible bug in query planner?

2018-12-03 Thread Jan Behrens
On Mon, 03 Dec 2018 11:47:17 -0500 Tom Lane wrote: > Jan Behrens writes: > > > However, the GiST index seems not to work as expected by me when > > 64-bit integers are involved. I tried to create a minimal > > proof-of-concept to demonstrate this. Consider the following setup: > > > > CREATE T

Re: How to watch for schema changes

2018-12-03 Thread Adrian Klaver
On 12/3/18 8:16 AM, Igor Korot wrote: Hi, Adrian, On Mon, Dec 3, 2018 at 9:17 AM Adrian Klaver wrote: On 12/2/18 5:24 AM, Igor Korot wrote: Hi, Adrian, Sorry for the delay to come back to this. I was busy doing other things. On Tue, Jul 3, 2018 at 12:32 PM Adrian Klaver wrote: On 07/03/2

Re: How to watch for schema changes

2018-12-03 Thread Igor Korot
On Mon, Dec 3, 2018 at 11:29 AM Adrian Klaver wrote: > > On 12/3/18 8:16 AM, Igor Korot wrote: > > Hi, Adrian, > > > > On Mon, Dec 3, 2018 at 9:17 AM Adrian Klaver > > wrote: > >> > >> On 12/2/18 5:24 AM, Igor Korot wrote: > >>> Hi, Adrian, > >>> Sorry for the delay to come back to this. I was b

Re: How to watch for schema changes

2018-12-03 Thread Adrian Klaver
On 12/3/18 9:53 AM, Igor Korot wrote: So event triggers are associated with events(www.postgresql.org/docs/9.6/event-trigger-matrix.html) in a particular database. A rough description is that they are triggers on changes to the system catalogs. You could, I guess, create and drop them for each co

Re: How to watch for schema changes

2018-12-03 Thread David G. Johnston
On Mon, Dec 3, 2018 at 10:59 AM Adrian Klaver wrote: > > As I say - I'm trying to make it work from both ODBC and libpq > > connection (one at a time) IIUC what is being proposed is: Once, on the server, the DBA issues: CREATE EVENT TRIGGER (the function it runs issues NOTIFY 'channel-name' - ev

Re: Query never completes with an OR condition

2018-12-03 Thread Andrew Gierth
> "Kenneth" == Kenneth Marshall writes: Kenneth> The individual queries run as expected, but when the OR Kenneth> condition is added, it never finishes. http://blog.rhodiumtoad.org.uk/2017/01/22/performance-issues-with-ored-conditions/ -- Andrew (irc:RhodiumToad)

DROP CASCADE transitive dependencies

2018-12-03 Thread C GG
...PostgreSQL 9.5... `DROP SCHEMA blah;` reports all the dependent objects and advises to `DROP SCHEMA blah CASCADE;` ... Will DROP ... CASCADE traverse the entire dependency tree for each of the dependent objects (potentially dropping something unintended), or will it stop at the first level and

Re: Query never completes with an OR condition

2018-12-03 Thread Stephen Frost
Greetings, * Andrew Gierth (and...@tao11.riddles.org.uk) wrote: > > "Kenneth" == Kenneth Marshall writes: > > Kenneth> The individual queries run as expected, but when the OR > Kenneth> condition is added, it never finishes. > > http://blog.rhodiumtoad.org.uk/2017/01/22/performance-issues

Re: DROP CASCADE transitive dependencies

2018-12-03 Thread Tom Lane
C GG writes: > ...PostgreSQL 9.5... > `DROP SCHEMA blah;` reports all the dependent objects and advises to `DROP > SCHEMA blah CASCADE;` ... > Will DROP ... CASCADE traverse the entire dependency tree for each of the > dependent objects (potentially dropping something unintended), or will it > st

Re: DROP CASCADE transitive dependencies

2018-12-03 Thread C GG
On Mon, Dec 3, 2018 at 1:26 PM Tom Lane wrote: > C GG writes: > > ...PostgreSQL 9.5... > > `DROP SCHEMA blah;` reports all the dependent objects and advises to > `DROP > > SCHEMA blah CASCADE;` ... > > > Will DROP ... CASCADE traverse the entire dependency tree for each of the > > dependent obje

Re: DROP CASCADE transitive dependencies

2018-12-03 Thread Pavel Stehule
po 3. 12. 2018 v 20:07 odesílatel C GG napsal: > > > On Mon, Dec 3, 2018 at 1:26 PM Tom Lane wrote: > >> C GG writes: >> > ...PostgreSQL 9.5... >> > `DROP SCHEMA blah;` reports all the dependent objects and advises to >> `DROP >> > SCHEMA blah CASCADE;` ... >> >> > Will DROP ... CASCADE travers

Re: DROP CASCADE transitive dependencies

2018-12-03 Thread Alvaro Herrera
On 2018-Dec-03, C GG wrote: > data=# begin; > BEGIN > data=# DROP SCHEMA blah CASCADE; > NOTICE: drop cascades to 278 other objects > DETAIL: drop cascades to type blah.timeclock_compute_hours_type > ... > and 178 other objects (see server log for list) > data=# rollback; > ROLLBACK > data=# >

Re: How to watch for schema changes

2018-12-03 Thread Igor Korot
Hi, Adrian, On Mon, Dec 3, 2018 at 11:59 AM Adrian Klaver wrote: > > On 12/3/18 9:53 AM, Igor Korot wrote: > >> So event triggers are associated with > >> events(www.postgresql.org/docs/9.6/event-trigger-matrix.html) in a > >> particular database. A rough description is that they are triggers on

Re: How to watch for schema changes

2018-12-03 Thread Alvaro Herrera
On 2018-Dec-03, Igor Korot wrote: > But I will probably create it on every connection and delete on the > disconnect (see above). This sounds certain to create a mess eventually, when a connection drops unexpectedly. (Also, what will happens to connections that run concurrently with yours?) --

Re: How to watch for schema changes

2018-12-03 Thread Adrian Klaver
On 12/3/18 1:53 PM, Igor Korot wrote: Hi, Adrian, Why? Just create the trigger once in a script. Event triggers are an attribute of the database and stay with it until they are dropped. If you want to turn then on and off use the ALTER EVENT TRIGGER ENABLE/DISABLE. If you insist on recreatin

Re: How to watch for schema changes

2018-12-03 Thread Adrian Klaver
On 12/3/18 1:53 PM, Igor Korot wrote: Hi, Adrian, Why? Just create the trigger once in a script. Event triggers are an attribute of the database and stay with it until they are dropped. If you want to turn then on and off use the ALTER EVENT TRIGGER ENABLE/DISABLE. If you insist on recreating

Re: How to watch for schema changes

2018-12-03 Thread Igor Korot
Hi, Adrian, On Mon, Dec 3, 2018 at 4:10 PM Adrian Klaver wrote: > > On 12/3/18 1:53 PM, Igor Korot wrote: > > Hi, Adrian, > > >> Why? Just create the trigger once in a script. Event triggers are an > >> attribute of the database and stay with it until they are dropped. If > >> you want to turn th

Re: How to watch for schema changes

2018-12-03 Thread Adrian Klaver
On 12/3/18 3:00 PM, Igor Korot wrote: Hi, Adrian, On Mon, Dec 3, 2018 at 4:10 PM Adrian Klaver wrote: On 12/3/18 1:53 PM, Igor Korot wrote: Hi, Adrian, Why? Just create the trigger once in a script. Event triggers are an attribute of the database and stay with it until they are dropped. I

Re: How to watch for schema changes

2018-12-03 Thread Igor Korot
Hi, Adrian, On Mon, Dec 3, 2018 at 5:15 PM Adrian Klaver wrote: > > On 12/3/18 3:00 PM, Igor Korot wrote: > > Hi, Adrian, > > > > On Mon, Dec 3, 2018 at 4:10 PM Adrian Klaver > > wrote: > >> > >> On 12/3/18 1:53 PM, Igor Korot wrote: > >>> Hi, Adrian, > >> > Why? Just create the trigger on

Re: How to watch for schema changes

2018-12-03 Thread Adrian Klaver
On 12/3/18 5:29 AM, Igor Korot wrote: Hi, Adrian, On Mon, Dec 3, 2018 at 5:15 PM Adrian Klaver wrote: On 12/3/18 3:00 PM, Igor Korot wrote: Hi, Adrian, What I mean to say was "no schema changes/server changes that comes independently of the program install". Or something to that extent.