pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: raf@raf.org
To: pgsql-general@postgresql.org
Subject: Re: Inconsistent compilation error
Date: Wed, 18 Apr 2018 20:16:20 -0700
Message-ID: <938e3908-6dc2-7a6b-40d9-04a29c4f4c3f@aklaver.com> (raw)
In-Reply-To: <20180419010228.jcogqkeu2b7bxh2q@raf.org>
References: <20180419010228.jcogqkeu2b7bxh2q@raf.org>

On 04/18/2018 06:02 PM, raf@raf.org wrote:
> Hi,
> 
> postgresql-9.5.12 on debian-9
> 
> I have a stored function with code that looks like:
> 
>      create or replace function tla_audit_delete_thing()
>      returns boolean stable language plpgsql as $$
>      declare
>          r record;
>          status boolean := 1;
>      begin
>          for r in select _.* from blah_history _ where _.original_id not in (select id from blah)
>          loop
>              raise notice '% %', 'blah_history.original_id', r;
>              status := 0;
>      end loop;
>      [...]
>      end
>      $$
>      security definer
>      set search_path = public, pg_temp;
>      revoke all on function tla_audit_delete_thing() from public;
>      grant execute on function tla_audit_delete_thing() to staff;

So if you cut and paste the above directly into the database via psql on 
the Debian host do you see the same issue?

> 
> And I have a program that loads stored functions from disk
> when they are different to what's in the database and I have
> just loaded a very old database backup, brought the schema up
> to date, and tried to bring the stored functions up to date.
> 

> 
> cheers,
> raf
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (15+ messages)  latest in thread

Message-ID: <938e3908-6dc2-7a6b-40d9-04a29c4f4c3f@aklaver.com>
Permalink:  ../938e3908-6dc2-7a6b-40d9-04a29c4f4c3f@aklaver.com/
Also on:    postgresql.org/message-id/938e3908-6dc2-7a6b-40d9-04a29c4f4c3f@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, raf@raf.org
  Subject: Re: Inconsistent compilation error
  In-Reply-To: <938e3908-6dc2-7a6b-40d9-04a29c4f4c3f@aklaver.com>
  References: <20180419010228.jcogqkeu2b7bxh2q@raf.org> <938e3908-6dc2-7a6b-40d9-04a29c4f4c3f@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox