[GENERAL] Aggregation ordering with GROUP BY

2005-08-10 Thread Thomas Schoen
Hi, my problem is best descibed giving an example: Assume you wrote a simple aggregate function called "agg_array_append" wich appends integer values to an array. Further assume you have a table "foo" with three integer fields "a", "b" and "c". test=# select * from foo; a | b | c ---+---+

[GENERAL] Does IMMUTABLE have any effect on functions?

2005-03-03 Thread Thomas Schoen
Hi, i wonder if the attribute IMMUTABLE has any effect on functions. Maybe its not implemented yet? I tried the following: CREATE TABLE foo (bar int4); CREATE FUNCTION foo(int4) RETURNS int4 AS ' INSERT INTO foo (bar) VALUES ($1); SELECT $1; ' LANGUAGE 'sql' IMMUTABLE; ...now without any tr

Re: [GENERAL] ORDER BY with plpgsql parameter

2004-06-02 Thread Thomas Schoen
> You need to use the FOR-IN-EXECUTE style of query. That way > you can use any string you want (including text passed in as > a parameter) to build the query inside the function ... that is what i want to avoid. (i wrote that in my first mail) My question was about why it is not possible to do it

[GENERAL] ORDER BY with plpgsql parameter

2004-06-01 Thread Thomas Schoen
Hi, is it possible to use a parameter of a plpgsql-function to order a selection inside the function? What i would like to do is pass a column-name/alias-name to a plpgsql function and use the variable as order-by-parameter like this: create function foo(varchar) RETURNS SETOF test AS '