[postgis-users] Query for all the polygon tables

chodgson@refractions.net chodgson@refractions.net
Wed Nov 19 18:10:25 2003


If you haven't figured this out already, try this:

SELECT DISTINCT f_table_name FROM geometry_columns;

HTH.
Chris

Quoting Matt Lynch <matt@terraEngine.com>:

> Hi Paul,
> 
> I have used addgeometry column for all my tables, so how would I do the
> query?
> 
> Thanks,
> 
> Matt
> 
> -----Original Message-----
> From: postgis-users-bounces@postgis.refractions.net
> [mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of Paul
> Ramsey
> Sent: Tuesday, November 18, 2003 2:40 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Query for all the polygon tables
> 
> 
> If you manage your columns carefully using addgeometrycolumn and
> dropgeometrycolumn, you should be able to do this with a trivial query
> against GEOMETRY_COLUMNS.
> 
> Paul
> 
> Matt Lynch wrote:
> 
> > Hi,
> >
> > I would like to be able to query for all the polygon tables in a
> > specific postgis database.
> >
> > I dug around on the net and figured out how to find all the tables,
> > that is
> >
> > SELECT c.relname, 'table'::text, u.usename FROM pg_class c,pg_user u
> > WHERE c.relowner = u.usesysid AND c.relkind='r' AND NOT EXISTS (SELECT
> 
> > 1 FROM pg_views WHERE viewname=c.relname) AND c.relname !~ '^pg_';
> >
> > Now I need some help to restrict to the polygon tables.
> >
> > Any suggestions?
> >
> > Thanks,
> >
> > Matt
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.532 / Virus Database: 326 - Release Date: 10/27/2003
> >
> >
> >
> >
> > _______________________________________________
> > postgis-users mailing list postgis-users@postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 
> --
>        __
>       /
>       | Paul Ramsey
>       | Refractions Research
>       | Email: pramsey@refractions.net
>       | Phone: (250) 885-0632
>       \_
> 
> 
> _______________________________________________
> postgis-users mailing list postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.532 / Virus Database: 326 - Release Date: 10/27/2003
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.532 / Virus Database: 326 - Release Date: 10/27/2003
> 
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>