[Help] AGGREGATE problem w/v7.0 - Mailing list pgsql-general

From Itzinger, Oskar
Subject [Help] AGGREGATE problem w/v7.0
Date
Msg-id FD2A5FEE4C3AD511A77B00508BB8538A01190C@OPECEXCH
Whole thread Raw
Responses Re: [Help] AGGREGATE problem w/v7.0  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi,

Under PostgreSQl 7.0, running the following from a shell script,


#!/sbin/sh

psql mybase << END

CREATE FUNCTION foo(TEXT, TEXT) RETURNS TEXT AS
  'SELECT \$1 || '', '' || \$2'
  LANGUAGE 'sql';

CREATE AGGREGATE foo_a (
  BASETYPE = TEXT,
  SFUNC1 = foo,
  STYPE1 = TEXT,
  INITCOND1 = ''
);

CREATE TEMPORARY TABLE tmp (id TEXT, entry TEXT);
INSERT INTO tmp VALUES('abc', 'kls');
INSERT INTO tmp VALUES('abc', 'mnr');
INSERT INTO tmp VALUES('def', 'opq');
INSERT INTO tmp VALUES('def', 'zyw');

SELECT id, foo_a(entry) FROM tmp GROUP BY id;

END


/why/ does SELECT give up with


ERROR:  SQL-language function not supported in this context.


- Is this a bug/limitation (at least the Programmer's Guide for PostgreSQL
7.0,
  Chapters 4 & 7, doesn't seem to volunteer a clue)?
- What am I doing wrongly?
- What exactly is meant by "this context"?
- How can I rectify this situation (besides hacking up Perl code for my
  purpose, which I finally did)?


Thanks for your advice.

/oskar


pgsql-general by date:

Previous
From: "F. Masselink"
Date:
Subject: function / trigger problem
Next
From: Allan Kamau
Date:
Subject: PLPGSQL: Using Transactions and locks