Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-25 Thread Rhys Stewart
ary a INNER JOIN subsumed_secondary b ON a.geom && b.geom AND a.id <> b.id WHERE dev.line_descriptor_2(simplify(a.geom,1.5)) = dev.line_descriptor_2(simplify(b.geom,1.5)) On Fri, Apr 25, 2008 at 12:07 PM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: > Rhys Stewart wrote:

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-25 Thread Rhys Stewart
ondary ( geom geometry, id serial NOT NULL, CONSTRAINT subsumed_secondary_pkey PRIMARY KEY (id)) On Thu, Apr 24, 2008 at 5:43 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Thu, Apr 24, 2008 at 3:43 PM, Rhys Stewart <[EMAIL PROTECTED]> > wrote: > > > type). That

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-24 Thread Rhys Stewart
amp; Love| Live Long & Prosper On Wed, Apr 23, 2008 at 1:37 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > I'd say you need to rethink your schema. > > On Wed, Apr 23, 2008 at 12:11 PM, Rhys Stewart <[EMAIL PROTECTED]> > wrote: > > Hi all, >

[GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Rhys Stewart
Hi all, have the following table aid| bid -- 1|5 2|6 3|7 4|9 5|1 6|2 7|3 8|10 9|4 10 |8 both aid & bid represent the same data in another table, but the table has duplicate data and i did a self-join to get the id's out. The question is how do

Re: [GENERAL] (un)grouping question

2008-01-22 Thread Rhys Stewart
lue) > ) t on (test.uid = t.uid), > (select max(somevalue) from test) a > > Rhys Stewart wrote: > > ok, let me clarify, dont want to remove them just want them changed > > but need to keep the uid. However, I would like just one somevalue to > > remain the same. so for exam

Re: [GENERAL] (un)grouping question

2008-01-21 Thread Rhys Stewart
<[EMAIL PROTECTED]>: > > On Mon, 2008-01-21 at 12:36 -0500, Rhys Stewart wrote: > > Hi list, > > > > have the following table > > > > uid|somevalue > > > > 1|11 > > 2|44 > > 3|31 > > 4|44 > > 5|71

[GENERAL] (un)grouping question

2008-01-21 Thread Rhys Stewart
Hi list, have the following table uid|somevalue 1|11 2|44 3|31 4|44 5|71 6|33 7|33 8|44 9|14 would like to remove the duplicate values in the column somevalue. doing this by just adding a random number is perfectly fine, however i want to retain at least one of the original

[GENERAL] move whole schema to a new tablespace

2007-10-09 Thread Rhys Stewart
Hi all, short of issuing single commands for each table is there a way to move the an entire schema to a new tablespace, indices and all? ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an i

Re: [GENERAL] set returning functions.

2007-09-24 Thread Rhys Stewart
yes indeed. thats exactly it scott!!! On 9/24/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On 9/24/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > Hello Rhys > > > > its not mystery > > Yeah, but I think he wanted to be able to make his own function he > could call like: > > select myfunc(10);

[GENERAL] set returning functions.

2007-09-24 Thread Rhys Stewart
Hi all, How can one make a set-returning function behave like generate_series(). If I cobble up an srf with plpgsql i have to do select * from mysrf(). But i can do select generate_series(1,10) or select this, that,the other,generate_series(1,5) from sometable. Essentially I would like to be able

Re: [GENERAL] regexp searching in arrays not working?

2007-06-20 Thread Rhys Stewart
thats cool, thanks. 2007/6/19, Tom Lane <[EMAIL PROTECTED]>: "Rhys Stewart" <[EMAIL PROTECTED]> writes: > Is regex searching not functioning (as i expect it to?) ~ expects the pattern on the right, not the left. So it's taking your array entries as patter

[GENERAL] regexp searching in arrays not working?

2007-06-19 Thread Rhys Stewart
Hi all, have a column which is of type text[]. the following works: select * from table where 'Transformer' = ANY (thiscol) this also works select * from table where 'Transformer' ~ ANY (thiscol) however if i have a partial string like so select * from table where 'Trans'

[GENERAL] help with function

2007-06-16 Thread Rhys Stewart
Hi all, trying to write a function to do the following: 1. select a random *unused* (see below) row from a table. 2. select 9 more rows from same table based on relation to first row selected 3. mark these 10 rows as used and assign a group 4. goto 1 5 when all rows are used, return the set of ro

Re: [GENERAL] what to do when pg_cancel_backend() doesnt work?

2007-06-04 Thread Rhys Stewart
a more readable version GISDEV=# select version(); version -- PostgreSQL 8.1.5 on i686-pc-mingw32, compiled by GCC gcc.exe (G

Re: [GENERAL] what to do when pg_cancel_backend() doesnt work?

2007-06-04 Thread Rhys Stewart
) GISDEV=# On 6/4/07, Alvaro Herrera <[EMAIL PROTECTED]> wrote: Rhys Stewart escribió: > Well, > that pretty much sums it up. pg_cancel_backend() is not working. The > query is still there. The box is across the city and the admin is not > in, is there a way to remote resta

[GENERAL] what to do when pg_cancel_backend() doesnt work?

2007-06-04 Thread Rhys Stewart
Well, that pretty much sums it up. pg_cancel_backend() is not working. The query is still there. The box is across the city and the admin is not in, is there a way to remote restart the server from within PG? ---(end of broadcast)--- TIP 6: explain

Fwd: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Rhys Stewart
-- Forwarded message -- From: Rhys Stewart <[EMAIL PROTECTED]> Date: Mar 20, 2007 6:50 PM Subject: Re: [GENERAL] Approximate join on timestamps To: Phil Endecott <[EMAIL PROTECTED]> had a similar problem a while back. so i made and abs_time function: CREATE OR REPL

[GENERAL] group by and aggregate functions on regular expressions

2007-03-08 Thread Rhys Stewart
Hi all, i have a table with an address column. I wanted to count the number of rows with a given regex match. so i ended up with the following very verbose query: select address ~* 'magil' as Magil , address ~* 'whitewater' as whitewater, (address ~* 'inswood' or address

Re: [GENERAL] Installing support for python on windows

2007-02-20 Thread Rhys Stewart
Ok so i am having trouble installing plpython, and found this thread. Howevre, after adding postgresql/bin to the path and the python lib directory to the path i still get: createlang: language installation failed: ERROR: could not load library "C:/Pro gram Files/PostgreSQL/8.2/lib/plpython.dll

[GENERAL] not so sequential sequences

2006-10-17 Thread Rhys Stewart
Hi all, looking for a method to number a table sequentially, but the sequence only increments if the value in a certain column is different. as in seq| parish 1 | Kingston 1 | Kingston 1 | Kingston 1 | Kingston 2 | Lucea 3 | Morant Bay

[GENERAL] rewriting query to move filter conditionout of a subselect

2006-10-11 Thread Rhys Stewart
Hi all I have the following query that sources two tables: select pi2.* from allpoints2 a1 inner join prem_info pi2 on pi2.prem = a1.prem AND the_geom is null AND pi2.multiplier > 1 where route in (select route from prem_info pi inner join allpoints2 a on a.prem = pi.prem where feederid = '241/6-

Re: [GENERAL] function is quick for one row but super slow on more than 5..

2006-07-20 Thread Rhys Stewart
Hi All, the following takes about 2 seconds to run: select route,not_in_route2(route) from ksanrt limit 5, but if i limit it to anything greater than 5 it takes forever to come back. Forever as in I always cancel the query. Any reasons why? On 7/19/06, Rhys Stewart <[EMAIL PROTECTED]>

Re: [GENERAL] function taking a long time. any options o speed it up.

2006-07-19 Thread Rhys Stewart
well i started by creating a table with the data i needed, instead of working on the big tablethat helped a whole lot. thanks. On 7/18/06, Michael Fuhr <[EMAIL PROTECTED]> wrote: On Tue, Jul 18, 2006 at 08:11:40AM -0500, Rhys Stewart wrote: > i created a function and it takes a lon

[GENERAL] function taking a long time. any options o speed it up.

2006-07-18 Thread Rhys Stewart
Hi all, i created a function and it takes a long time to run. I was testing it as a wrote it and to the first drop table it takes just short of a second. however when the rest of the code is added on, it takes upwards of 5 minutes. Not the most appropriate thing. Are there any tips out there for

[GENERAL] list or regular expressions

2006-06-26 Thread Rhys Stewart
Hi all, can i search in a list or regular expressioneg "select yadi from ya where yadiya in ('old', 'ulk', 'orb')" but instead of in ther'd be another operator or a LIKE IN. so it'd be a shorcut for typing yadiya ~* 'old' or yadiya ~* 'ulk' etc. ---(end of broadcast)

[GENERAL] JUST NOT ADDING UP

2006-06-23 Thread Rhys Stewart
hi all, something is not adding up. the following query is taking a long time to run.(its still running right now) select distinct on (prem) prem, num, addy, mynum,myad,ff.address, matchtype, the_geom from daily.recheck2, _sp_myparcels ff where prem not in ( select distinct on (prem) prem from d

[GENERAL] pl/pgsql question

2006-05-12 Thread Rhys Stewart
hi all, are there any function in pl/pgsql to call a shell script? or like is there a pl/bash? Rhys Peace & Love | Live Long & Prosper ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/doc