[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] How to get geometry enabled Tables form
From:       Mike Toews <mwtoews () gmail ! com>
Date:       2010-07-29 13:43:18
Message-ID: AANLkTikT7HcBF67x9Fp1pH1RVb4pE3R1+putEwGsD75b () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Oh, sorry, the search that looks for tables not listed in
geometry_columns/geography_columns is further down in the QGIS source:
https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselect.cpp?rev=13922#L714

<https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselect.cpp?rev=13922#L714>
-Mike

On 29 July 2010 06:34, Mike Toews <mwtoews@gmail.com> wrote:

> 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 <ven.tammineni@gmail.com> 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
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>

[Attachment #5 (text/html)]

Oh, sorry, the search that looks for tables not listed in \
geometry_columns/geography_columns is further down in the QGIS source:<div><a \
href="https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselec \
t.cpp?rev=13922#L714">https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselect.cpp?rev=13922#L714</a></div>


<div><br></div><div><a \
href="https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselect.cpp?rev=13922#L714"></a>-Mike</div><div><br><div \
class="gmail_quote">On 29 July 2010 06:34, Mike Toews <span dir="ltr">&lt;<a \
href="mailto:mwtoews@gmail.com">mwtoews@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;">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]):<div>

<br></div>
<div><div><div>select f_table_name, f_table_schema, upper(type), \
pg_class.relkind</div><div>from geometry_columns, pg_class, \
pg_namespace</div><div>where relname=f_table_name</div><div>    and \
f_table_schema=nspname</div>


<div>    and pg_namespace.oid=pg_class.relnamespace</div><div>    and \
has_schema_privilege(pg_namespace.nspname,&#39;usage&#39;)</div><div>    and \
has_table_privilege(&#39;&quot;&#39;||pg_namespace.nspname||&#39;&quot;.&quot;&#39;||pg_class.relname||&#39;&quot;&#39;,&#39;select&#39;)</div>



<div>order by f_table_schema,f_table_name;</div></div></div><div><br></div><div>To \
search geography, replace &quot;geometry_columns&quot; with \
&quot;geography_columns&quot;. Geography column support is new in QGIS, and is only \
in trunk at the moment.</div>


<div><br></div><div>[1] <a \
href="https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselect.cpp?rev=13922#L632" \
target="_blank">https://trac.osgeo.org/qgis/browser/trunk/qgis/src/app/postgres/qgspgsourceselect.cpp?rev=13922#L632</a><br>



<br></div><div>-Mike</div><div><br><div class="gmail_quote"><div><div></div><div \
class="h5">On 29 July 2010 05:57, venkat <span dir="ltr">&lt;<a \
href="mailto:ven.tammineni@gmail.com" \
target="_blank">ven.tammineni@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div><div></div><div class="h5"> <font \
color="#3366ff">Dear All,</font><div><font \
color="#3366ff"><br></font></div><div><font \
color="#3366ff"><br></font></div><div><font color="#3366ff">   How can i retrieve  \
only spatial enabled tables form the database(Postgresql/PostGIS).Please let me know. \
</font></div>



<div><font color="#3366ff"><br></font></div><div><font color="#3366ff">I am waiting \
for your great response.</font></div><div><font \
color="#3366ff"><br></font></div><div><font color="#3366ff">Thanks and \
Regards,</font></div>



<div><font color="#3366ff"><br></font></div><font color="#888888"><div><font \
color="#3366ff">Venkat</font></div> </font><br></div></div><div \
class="im">_______________________________________________<br> postgis-users mailing \
list<br> <a href="mailto:postgis-users@postgis.refractions.net" \
target="_blank">postgis-users@postgis.refractions.net</a><br> <a \
href="http://postgis.refractions.net/mailman/listinfo/postgis-users" \
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br> \
<br></div></blockquote></div><br></div> </blockquote></div><br></div>



_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic