[GRASS-user] Views in pgSQL

Jarosław Jasiewicz jarekj at amu.edu.pl
Wed Apr 11 07:48:48 EDT 2007


Moritz Lennert napisał(a):
> On 11/04/07 13:01, Jarosław Jasiewicz wrote:
>> Hi
>>
>> Is still possible to use pgSQL views to connect vectors?
>>
>> Connecting views was possible for or five month ago (in spite of 
>> error messages during creating views).
>>
>> I have some vector joinred to view They still working. But now, when 
>> I tried to connect new vector with view I recived simple error 
>> message that there is no table I plan to join
>
> What is the exact error message you are receiving.
>
>
>>
>> If that possibilites was removed (after my post, unfortunatly) please 
>> let me know
>
> I am not aware of any related changes...
>
> Moritz
here is the full sequence (parially pg SQL partially GRASS) what I do:

first create view from existing table:

CREATE  VIEW az AS
 SELECT azp.cat, azp.x, azp.y
   FROM azp;

ALTER TABLE az OWNER TO jarekj;

the rule _RETURN creates automatically

next I GRAND privilegres to me and public (it is not reqiued only for 
testing)

GRANT ALL ON TABLE az TO jarekj;
GRANT ALL ON TABLE az TO public;

the view exist and return valuses as it should

next I try to connect the vector to view:

v.db.connect -o map=azp driver=pg database=smigiel table=az key=cat layer=1

and I recive:

GRASS_INFO_ERROR(24563,1): Table <az> does not exist in database <smigiel>

thatt all

few month ago there were addational messages, that <az> is not a table 
but finally vector has ben joined



 >>What does v.db.select give you ?


v.db.select after try returns:

v.db.select map=azp layer=1 where=cat=100 fs=|

cat|arkuszazp|nr_punktu|x|y|point_x|point_y|jez5000|cat5000|area5000|slope3|slope7|aspect3|aspect7|planc7|planc3|profc3|profc7|slope3_red|aspect3_red|profc3_red|planc3_red|jez10000|jez_cat10000|jez_area10000|rz_odl10000|rz_cat10000|rz_dlug10000|azp|rzedna3|rzedna|rzedna7
100|5823|96|328403.553622|476229.002808|3690816.99988|5677633.31919|4028.11|6684|1799.08|2.23229|1.61983|-82.875|-81.573|-0.00474|-0.008193|-0.000599|-0.000085|2.23229|-82.875|-0.000599|-0.008193|4028.11|6684|1799.08|672.713|24385|5120.79|5823_96|||




but:

echo "SELECT * FROM az WHERE cat=100"|db.select

returns:

cat|x|y
100|328403.553622|476229.002808


thanks for interesting
regards
Jarek




BTW:
Pg Views are very important for me when I connect-reconnect vector files 
to different atribute table. I use (used!) views insted of original 
table to avoid occasional removing original data and to speed up 
transfer limiting data in views only to these needed for
(sorry, I think everybody knows it)







More information about the grass-user mailing list