Database Reference
In-Depth Information
are part of
group1
can now use the
INSERT
statement to add new spatial
reference systems.
18. Let'sgive
user2
,whichisamemberof
group1
,theabilityusethe
UPDATE
and
DELETE
statements on
spatial_ref_sys
by executing the following
command; we are not going to give anyone the privilege to use the
TRUNCATE
statement on
spatial_ref_sys
:
GRANT UPDATE, DELETE ON spatial_ref_sys
TO user2;
19. Afterestablishingtheprivileges,itisalwaysgoodpracticetocheckthatthey
actuallywork.Thebestwaytodosoisbyloggingintothedatabaseasoneof
oftheusers.Wewillusethe
user3
usertocheckbyexecutingthefollowing
command:
> psql -d chapter10 -u user3
20. Now,checkthatwecanruna
SELECT
statementonthe
spatial_ref_sys
table by executingthe following commands:
chapter10=# SELECT count(*) FROM
spatial_ref_sys;
count
-------
3911
(1 row)
21. Let'stryinsertinganewrecordin
spatial_ref_sys
byexecutingthefol-
lowing commands:
chapter10=# INSERT INTO spatial_ref_sys
VALUES (99999, 'test', 99999, '', '');
ERROR: permission denied for relation
spatial_ref_sys
22. Excellent! Now update records in
spatial_ref_sys
by executing the fol-
lowing commands: