grant under SQL92

grant under SQL92

Post by Oliver Elphic » Thu, 22 Mar 2001 01:01:37



  >test=> create table test (col1 int,col2 int);
  >test=> grant select on test (col1) to user1;
  >ERROR: parser: parse error at or near "("
  >
  >
  >I'm trying to use GRANT with SQL92 extentions,(set permissions on
  >the individual column) but it dosn't work.
  >
  >Where I was wrong ?
  >Please, help me.

Sorry.  That feature is not yet supported at all.  You can only grant
permissions on whole tables.

  >from aw_pgsql_book:
  >>The SQL92 syntax for GRANT allows setting privileges for individual columns
      > within a table, and
  >>allows setting a privilege to grant the same privileges to others:
  >>GRANT privilege [, ...]
  >>ON object [ ( column [, ...] ) ] [, ...]
  >           ^^^^^^^^^^^^^^^^^^^^^
  >>TO { PUBLIC | username [, ...] }
  >>[ WITH GRANT OPTION ]
  >
  >by default, I can use SQL92 format - is it right??

No.  You quoted from the compatibility section of the GRANT manual page, which
lists what SQL92 allows and PostgreSQL does not!

SQL92 (SQL99?) compatibility is a lon-term goal which has not yet been
attained.

--

Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "I am crucified with Christ; nevertheless I live; yet
      not I, but Christ liveth in me; and the life which I
      now live in the flesh I live by the faith of the Son
      of God, who loved me, and gave himself for me."      
                                 Galatians 2:20

---------------------------(end of broadcast)---------------------------