create policy/using expression

From: "Voillequin, Jean-Marc" <Jean-Marc(dot)Voillequin(at)moodys(dot)com>
To: "pgsql-sql(at)lists(dot)postgresql(dot)org" <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: create policy/using expression
Date: 2018-09-14 09:22:31
Message-ID: 1EC8157EB499BF459A516ADCF135ADCE39FC8F49@LON-WGMSX712.ad.moodys.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

When I create a policy on a table, is it possible to call a function (in the using expression) that takes the whole table record as a parameter, something like:
create table my_table(col1....coln);
create policy my_policy on my_table using (my_func(<record>));

my_table has tons of columns (more than one hundred), I would like to avoid to name them when creating the policy:
create policy my_policy on my_table for select using (my_func(col1,col2,col3,...,coln));

Regards
-----------------------------------------

Moody's monitors email communications through its networks for regulatory compliance purposes and to protect its customers, employees and business and where allowed to do so by applicable law. The information contained in this e-mail message, and any attachment thereto, is confidential and may not be disclosed without our express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify us by telephone, fax or e-mail and delete the message and all of its attachments. Every effort is made to keep our network free from viruses. You should, however, review this e-mail message, as well as any attachment thereto, for viruses. We take no responsibility and have no liability for any computer virus which may be transferred via this e-mail message.

This email was sent to you by Moody’s Investors Service EMEA Limited
Registered office address:
One Canada Square
Canary Wharf
London, E14 5FA
Registered in England and Wales No: 8922701

-----------------------------------------

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2018-09-21 15:08:41 select where not in () fails
Previous Message David Raymond 2018-09-10 20:39:55 RE: md5 and trust and pg_hba.conf