SECURITY LABEL(7)       PostgreSQL 9.1.4 Documentation       SECURITY LABEL(7)



NNAAMMEE
       SECURITY_LABEL - define or change a security label applied to an object

SSYYNNOOPPSSIISS
       SECURITY LABEL [ FOR _p_r_o_v_i_d_e_r ] ON
       {
         TABLE _o_b_j_e_c_t___n_a_m_e |
         COLUMN _t_a_b_l_e___n_a_m_e._c_o_l_u_m_n___n_a_m_e |
         AGGREGATE _a_g_g___n_a_m_e (_a_g_g___t_y_p_e [, ...] ) |
         DOMAIN _o_b_j_e_c_t___n_a_m_e |
         FOREIGN TABLE _o_b_j_e_c_t___n_a_m_e
         FUNCTION _f_u_n_c_t_i_o_n___n_a_m_e ( [ [ _a_r_g_m_o_d_e ] [ _a_r_g_n_a_m_e ] _a_r_g_t_y_p_e [, ...] ] ) |
         LARGE OBJECT _l_a_r_g_e___o_b_j_e_c_t___o_i_d |
         [ PROCEDURAL ] LANGUAGE _o_b_j_e_c_t___n_a_m_e |
         SCHEMA _o_b_j_e_c_t___n_a_m_e |
         SEQUENCE _o_b_j_e_c_t___n_a_m_e |
         TYPE _o_b_j_e_c_t___n_a_m_e |
         VIEW _o_b_j_e_c_t___n_a_m_e
       } IS '_l_a_b_e_l'

DDEESSCCRRIIPPTTIIOONN
       SECURITY LABEL applies a security label to a database object. An
       arbitrary number of security labels, one per label provider, can be
       associated with a given database object. Label providers are loadable
       modules which register themselves by using the function
       rreeggiisstteerr__llaabbeell__pprroovviiddeerr.

           NNoottee
           rreeggiisstteerr__llaabbeell__pprroovviiddeerr is not an SQL function; it can only be
           called from C code loaded into the backend.

       The label provider determines whether a given label is valid and
       whether it is permissible to assign that label to a given object. The
       meaning of a given label is likewise at the discretion of the label
       provider.  PostgreSQL places no restrictions on whether or how a label
       provider must interpret security labels; it merely provides a mechanism
       for storing them. In practice, this facility is intended to allow
       integration with label-based mandatory access control (MAC) systems
       such as SE-Linux. Such systems make all access control decisions based
       on object labels, rather than traditional discretionary access control
       (DAC) concepts such as users and groups.

PPAARRAAMMEETTEERRSS
       _o_b_j_e_c_t___n_a_m_e, _t_a_b_l_e___n_a_m_e_._c_o_l_u_m_n___n_a_m_e, _a_g_g___n_a_m_e, _f_u_n_c_t_i_o_n___n_a_m_e
           The name of the object to be labeled. Names of tables, aggregates,
           domains, foreign tables, functions, sequences, types, and views can
           be schema-qualified.

       _p_r_o_v_i_d_e_r
           The name of the provider with which this label is to be associated.
           The named provider must be loaded and must consent to the proposed
           labeling operation. If exactly one provider is loaded, the provider
           name may be omitted for brevity.

       _a_r_g___t_y_p_e
           An input data type on which the aggregate function operates. To
           reference a zero-argument aggregate function, write * in place of
           the list of input data types.

       _a_r_g_m_o_d_e
           The mode of a function argument: IN, OUT, INOUT, or VARIADIC. If
           omitted, the default is IN. Note that SECURITY LABEL ON FUNCTION
           does not actually pay any attention to OUT arguments, since only
           the input arguments are needed to determine the function's
           identity. So it is sufficient to list the IN, INOUT, and VARIADIC
           arguments.

       _a_r_g_n_a_m_e
           The name of a function argument. Note that SECURITY LABEL ON
           FUNCTION does not actually pay any attention to argument names,
           since only the argument data types are needed to determine the
           function's identity.

       _a_r_g_t_y_p_e
           The data type(s) of the function's arguments (optionally
           schema-qualified), if any.

       _l_a_r_g_e___o_b_j_e_c_t___o_i_d
           The OID of the large object.

       PROCEDURAL
           This is a noise word.

       _l_a_b_e_l
           The new security label, written as a string literal; or NULL to
           drop the security label.

EEXXAAMMPPLLEESS
       The following example shows how the security label of a table might be
       changed.

           SECURITY LABEL FOR selinux ON TABLE mytable IS 'system_u:object_r:sepgsql_table_t:s0';

CCOOMMPPAATTIIBBIILLIITTYY
       There is no SECURITY LABEL command in the SQL standard.

SSEEEE AALLSSOO
       sepgsql, dummy_seclabel



PostgreSQL 9.1.4                  2012-05-31                 SECURITY LABEL(7)
