Subject: What built-in functions are there?

From: [email-masked] (Leif Neve)
Date: Tue, 1 Sep 92 12:54:26 -0700

Folks,

How can I find the list of available built-in functions?

In particular, I want to extract max(rel.attribute).

Leif Neve ([email-masked])

---

From: <[email-masked]>
Date: Tue, 01 Sep 92 13:03:11 PDT

> In particular, I want to extract max(rel.attribute).

you want to use an aggregate, not a function.  functions take a single
argument list and return a single value.  an aggregate is called with
a bunch of values iteratively, and returns a single value at the end.

the syntax for the operation you want is

    retrieve (max = int2max{rel.attribute})

if rel.attribute is an int2.  the set of available attributes is listed
in pg_attribute; you can say

    retrieve (name = a.aggname, argtype = t1.typname, rettype = t2.typname)
	    from a in pg_aggregate, t1 in pg_type, t2 in pg_type
	    where a.inttype = t1.oid and a.fintype = t2.oid

to list all defined aggregates, the argument type they expect, and the
value of the type they return.
					mike olson
					project sequoia 2000
					uc berkeley
					[email-masked]