[postgis-users] AddGeometryCOlumn error on View

Fred Lehodey lehodey at gmail.com
Fri May 29 09:35:31 PDT 2009


Hi Piotr,

you can try:

1)
CREATE SEQUENCE my_seq START 1

2)
CREATE VIEW my_view AS
SELECT nextval('my_seq'), otherfield, ...
FROM mytable1, mytable2


HTH,
Fred





2009/5/29 Piotr Synowiec <psynowiec at gmail.com>

> Kevin Neufeld wrote:
>
>> Piotr Synowiec wrote:
>>  > Is there any particular reason why AddGeoemtryColumn doesn't work on
>>
>>> Views ?
>>>
>>>
>> AddGeometryColumn adds a column to a table and registers the column with
>> the geometry_columns.  If you want to add a geometry column to your VIEW,
>> alter your VIEW to select the column from an appropriate underlying table.
>>
> I have done it
>
>>
>> You're right that you will have to manually add or register the view with
>> geometry_columns for some applications to detect the view.
>>
> maybe I expressed myself not clearly.
> The thing is that AddGeometryColumn function complains that View is not a
> Table and it will not add geometry column to
> geometry_columns table
>
> It works after I insert data with INSERT
>
> Just didn't figure it out how to add unique ID field to my VIEW.
> The ID I have in my tables merged to the VIEW have repeating IDs
>
> Piotr
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090529/b93042a2/attachment.html>


More information about the postgis-users mailing list