The following screenshot is from an online learning platform I am using to learn SQL (more specifically PostgreSQL). I am concerned that I'm not understanding the following paragraph correctly.

enter image description here

It states that:

One shortcoming of SQL's approach to access control is that it only works on the granularity of whole tables (with the exception of the UPDATE privilege).

However, it appears I am entirely able to do the following to achieve the same result as creating a view and granting the SELECT privilege to the user for that view:

GRANT SELECT(studentId, uosCode) ON Enrolled TO SomeUser

Is the screenshot incorrect or have I misinterpreted something?

  • 1
    Whatever that source of the screenshot is, they clearly haven't followed the development of modern database systems. All major database systems support grant access on column level (Postgres supports since since 2009, Oracle has been supporting this since 2003. I don't know when DB2, SQL Server or MySQL started to support that) – a_horse_with_no_name Nov 19 '18 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.