You can either assume that they are all listed in geometry_columns or
geography_columns. Or you can do a more complicated query to include other
tables than in geometry/geography, (this is from QGIS code[1]):

select f_table_name, f_table_schema, upper(type), pg_class.relkind
from geometry_columns, pg_class, pg_namespace
where relname=f_table_name
    and f_table_schema=nspname
    and pg_namespace.oid=pg_class.relnamespace
    and has_schema_privilege(pg_namespace.nspname,'usage')
    and
has_table_privilege('"'||pg_namespace.nspname||'"."'||pg_class.relname||'"','select')
order by f_table_schema,f_table_name;

To search geography, replace "geometry_columns" with "geography_columns".
Geography column support is new in QGIS, and is only in trunk at the moment.

[1]
https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselect.cpp?rev=13922#L632

-Mike

On 29 July 2010 05:57, venkat <[email protected]> wrote:

> Dear All,
>
>
>    How can i retrieve  only spatial enabled tables form the
> database(Postgresql/PostGIS).Please let me know.
>
> I am waiting for your great response.
>
> Thanks and Regards,
>
> Venkat
>
> _______________________________________________
> postgis-users mailing list
> [email protected]
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to