Re: auditing in postgresql - Mailing list pgsql-general

From Merlin Moncure
Subject Re: auditing in postgresql
Date
Msg-id b42b73150708311045s33b4c41cn4cc5e05f940b0883@mail.gmail.com
Whole thread Raw
In response to Re: auditing in postgresql  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: auditing in postgresql  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-general
On 8/31/07, Jeff Davis <pgsql@j-davis.com> wrote:
> On Thu, 2007-08-30 at 21:43 -0400, Merlin Moncure wrote:
> > Well, a SRF may be unsuitable for various reasons, but maybe views are
> > better. I really like views more and more lately (better than
> > functions as a rule, I think).
> >
> > you have some query, select yadda
> > create view log_yadda as
> >   select yadda
> >     union all select null, null, null from log_func();
> >
>
> Interesting idea, I hadn't thought of that. Not perfect, but
> interesting.

create function func() returns bool as
$$
  begin
    raise notice 'log!';
    return true;
  end;
$$ language plpgsql;

how about this:
create view log_yadda sa
  select yadda where (select func());

the parens around the function call force it to be evaluated as a scalar.

:-)

merlin

pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: auditing in postgresql
Next
From: "Merlin Moncure"
Date:
Subject: Re: auditing in postgresql