Re: tables not in list - Mailing list pgsql-general

From Lee Keel
Subject Re: tables not in list
Date
Msg-id 76758090F8686C47A44B6FF52514A1D308C9C6B8@hermes.uai.int
Whole thread Raw
In response to tables not in list  (Lee Keel <lee.keel@uai.com>)
List pgsql-general
> -----Original Message-----
> From: Viatcheslav Kalinin [mailto:vka@ipcb.net]
> Sent: Tuesday, July 31, 2007 9:16 AM
> To: Lee Keel
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] tables not in list
>
> I usually resolve this as:
> -- this function lets you select from an array
> CREATE OR REPLACE FUNCTION "array_to_set" (vaarray anyarray) RETURNS
> SETOF anyelement AS
> $body$
> BEGIN
>    FOR I IN COALESCE(ARRAY_LOWER(VAARRAY, 1), 1) ..
> COALESCE(ARRAY_UPPER(VAARRAY, 1), 0) LOOP
>        RETURN NEXT VAARRAY[I];
>    END LOOP;
> END
> $body$
> LANGUAGE 'plpgsql';
>
> select table_name
>   from array_to_set(array['test', 'bar', 'foo']) as table_name
>   where table_name not in (select table_name from
> information_schema.tables where table_catalog='postgres' and
> table_type='BASE TABLE' and table_schema='public')
>
> regards

THANKS!  That was exactly what I needed!
This email and any files transmitted with it are confidential and intended solely for the use of the individual or
entityto whom they are addressed. If you have received this email in error please notify the sender. This message
containsconfidential information and is intended only for the individual named. If you are not the named addressee you
shouldnot disseminate, distribute or copy this e-mail. 

pgsql-general by date:

Previous
From: Viatcheslav Kalinin
Date:
Subject: Re: tables not in list
Next
From: Tom Lane
Date:
Subject: Re: Performance problem with large resultsets (byte array 2200)