Howdy,
I was just updating a function in pgTAP that, given a schema name and
an array of function names, returns a set of those function names that
are not in the named schema. I got it working with a subquery, and
David Fetter suggested that I try an EXCEPT query instead. The only
On Thu, 2009-02-19 at 17:13 -0800, David E. Wheeler wrote:
CREATE OR REPLACE FUNCTION mytest(NAME, NAME[]) RETURNS setof text AS
$$
SELECT quote_ident($2[i])
FROM generate_series(1, array_upper($2, 1)) AS s(i)
EXCEPT
SELECT quote_ident(p.proname)
David E. Wheeler wrote:
Howdy,
I was just updating a function in pgTAP that, given a schema name and
an array of function names, returns a set of those function names that
are not in the named schema. I got it working with a subquery, and
David Fetter suggested that I try an EXCEPT query
On Feb 19, 2009, at 5:45 PM, Andrew Dunstan wrote:
A limitation of this feature is that an ORDER BY clause applying to
the result of a UNION, INTERSECT, or EXCEPT clause can only specify
an output column name or number, not an expression.
Why not just say order by 1 ?
Well, in this case,
David E. Wheeler wrote:
On Feb 19, 2009, at 5:45 PM, Andrew Dunstan wrote:
A limitation of this feature is that an ORDER BY clause applying to
the result of a UNION, INTERSECT, or EXCEPT clause can only specify
an output column name or number, not an expression.
Why not just say order by
I wrote:
select foo from (
SELECT quote_ident($2[i]) as foo, i
FROM generate_series(1, array_upper($2, 1)) AS s(i)
EXCEPT
SELECT quote_ident(p.proname)
FROM pg_catalog.pg_proc p
JOIN pg_catalog.pg_namespace n
ON p.pronamespace = n.oid