[postgis-users] Query for all the polygon tables

Matt Lynch matt at terraEngine.com
Wed Nov 19 10:28:40 PST 2003


Hi Chris,

Thanks!  That did the trick.

Matt

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
chodgson at refractions.net
Sent: Wednesday, November 19, 2003 11:10 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] Query for all the polygon tables


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

SELECT DISTINCT f_table_name FROM geometry_columns;

HTH.
Chris

Quoting Matt Lynch <matt at 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 at postgis.refractions.net
> [mailto:postgis-users-bounces at 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 at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 
> --
>        __
>       /
>       | Paul Ramsey
>       | Refractions Research
>       | Email: pramsey at refractions.net
>       | Phone: (250) 885-0632
>       \_
> 
> 
> _______________________________________________
> postgis-users mailing list postgis-users at 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 at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 





_______________________________________________
postgis-users mailing list postgis-users at 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
 





More information about the postgis-users mailing list