[GENERAL] syntax error in a trigger. can't find it.

2013-01-12 Thread Rhys A.D. Stewart
Greetings, I must be very tired, very hungry or both. I'm getting a syntax error in the last line with the 'END;' But am clearly not seeing what the error is. Any help would be appreciated. create or replace function dev.rqst_insrt() returns trigger as $_$

Re: [GENERAL] syntax error in a trigger. can't find it.

2013-01-12 Thread Rhys A.D. Stewart
Found it, had ELSE IF instead of elsif..very from the indicated error. On Sat, Jan 12, 2013 at 5:10 PM, Rhys A.D. Stewart rhys.stew...@gmail.comwrote: Greetings, I must be very tired, very hungry or both. I'm getting a syntax error in the last line with the 'END;' But am clearly

[GENERAL] can one speed up a custom aggregate by using native ones

2012-12-18 Thread Rhys A.D. Stewart
Greetings, I have an aggregate function which basically concatenates a whole bunch of rows (that would be the sfunc) and then wraps it in a header and footer (the finalunc). It is however for fairly large set many orders of magnitude slower than running string_agg and then the finalfunc. Is

Re: [GENERAL] get column name passed to a function

2012-11-22 Thread Rhys A.D. Stewart
Feature request? Could it be shoved in before 9.2.2 or 9.2.3? On Tue, Nov 20, 2012 at 5:23 PM, Adrian Klaver adrian.kla...@gmail.comwrote: On 11/20/2012 01:34 PM, Rhys A.D. Stewart wrote: bummer. No, not dynamic queries just wanted to have the name of the columns along with the column

[GENERAL] get column name passed to a function

2012-11-20 Thread Rhys A.D. Stewart
Greetings, I'm looking to obtain the name of a column that is passed to a function, similar to xmlforest. Suggestions? Regards, Rhys

[GENERAL] Access disk from plpython

2012-11-14 Thread Rhys A.D. Stewart
Greetings all, having a permission issue with writing a file using plpython to a local folder, changed permissions to everyone read and write and even changed the owner to postgres. but no joy, any suggestions? Regards, Rhys

Re: [GENERAL] user defined XML aggregate not working as (i think) it should

2012-10-03 Thread Rhys A.D. Stewart
Thanks Tom, That was indeed the issue. Regards, Rhys On Wed, Oct 3, 2012 at 8:58 PM, Tom Lane t...@sss.pgh.pa.us wrote: Rhys A.D. Stewart rhys.stew...@gmail.com writes: I have an xml aggregate function that always returns 'ERROR: invalid XML content'. However an identical function

[GENERAL] Does continue in a loop not commit any changes

2012-08-24 Thread Rhys A.D. Stewart
Greetings all, Having an issue with the pl/pgsql function below. I may or may not make an update to a table in the first IF statement. However, whenever an update is made, if the loop is continued then the update is not committed. Is it that whenever a loop is not completed rows aren't written?

[GENERAL] index issues with generate_series.....or why this index os not working

2011-06-07 Thread Rhys A.D. Stewart
Greetings!! I'm not sure why the query is not using the gist index in the table base.parishes. Any suggestions? __ CREATE TABLE base.parishes ( gid serial NOT NULL, parish text, COUNT integer, SUM_AREA double precision, SUM_ELECTO double

Re: [GENERAL] ignore errors for COPY

2010-11-11 Thread Rhys A.D. Stewart
On Thu, Nov 11, 2010 at 8:05 AM, Guillaume Lelarge guilla...@lelarge.info wrote: Le 11/11/2010 13:01, Vangelis Katsikaros a écrit : Hello I have postrges 8.3.12 and I have the following issue: I have a table create table test(      table_id integer,      datetime timestamp,      MMSI

[GENERAL] versioned pl/pgsql functions

2010-09-21 Thread Rhys A.D. Stewart
hey all, I think versioned pl/[pgsql|python|perl|bash|java] functions would be a great addition to 9.1. Imagine that instead of CREATE OR REPLACE FUNCTION you could do CREATE AND VERSION FUNCTION and then all modifications to the function could be versioned so that you could revert/rollback to a

[GENERAL] how to identify outliers

2009-10-27 Thread Rhys A.D. Stewart
Hey all, I have the following table: data(pnum text, distance float8, route text). I would like to remove the outliers in distance, i.e. lets say i get the avg dist of pnum for each route and the std deviation of the distance what is the best way to identify the outliers? Rhys. -- Sent via

Re: [GENERAL] how to identify outliers

2009-10-27 Thread Rhys A.D. Stewart
: Are you asking how to find the average and standard deviation? Or how to compare the your data against some set values? Perhaps an example would be appropriate; it's not very clear to me what you're asking. Rhys A.D. Stewart wrote: Hey all, I have the following table:  data(pnum text, distance

[GENERAL] in query variables....

2008-07-17 Thread Rhys A.D. Stewart
Hi all, this is from the is there a way file. Is there a way to get the name of the relation or relations in a query from within the query? Like some kind of magic variable...? for example : select *, some_magic_variable from thistable where some_magic_variable would be replaced by