pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: suhas.basavaraj12 <suhas.b@verse.in>
To: pgsql-admin@postgresql.org
Subject: PG_REORG ISSUE
Date: Tue, 27 Nov 2012 21:37:05 -0800 (PST)
Message-ID: <1354081025812-5733850.post@n5.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Hi,

 Found  a peculiar issue with reorg_trigger  on one of the important table
in the db.
 SELECT>ERROR:  must be superuser to use reorg_trigger function.
Due to this  , table was not accessible by application and all the stored
procedures which run on that table failed.
I did \d affected_table , but that trigger was not there on that table .But
when i searched in schema i found below trigger 

CREATE FUNCTION conflicted_triggers(oid) RETURNS SETOF name
    LANGUAGE sql STABLE STRICT
    AS $_$
SELECT tgname FROM pg_trigger
 WHERE tgrelid = $1 AND tgname >= 'z_reorg_trigger'
$_$;

CREATE FUNCTION get_create_trigger(relid oid, pkid oid) RETURNS text
    LANGUAGE sql STABLE STRICT
    AS $_$
  SELECT 'CREATE TRIGGER z_reorg_trigger' ||
         ' BEFORE INSERT OR DELETE OR UPDATE ON ' || reorg.oid2text($1) ||
         ' FOR EACH ROW EXECUTE PROCEDURE reorg.reorg_trigger(' ||
         '''INSERT INTO reorg.log_' || $1 || '(pk, row) VALUES(' ||
         ' CASE WHEN $1 IS NULL THEN NULL ELSE (ROW($1.' ||
         reorg.get_index_columns($2, ', $1.') || ')::reorg.pk_' ||
         $1 || ') END, $2)'')';
$_$;


CREATE TRIGGER z_reorg_trigger BEFORE INSERT OR DELETE OR UPDATE ON
AFFECTED_TABLE
FOR EACH ROW EXECUTE PROCEDURE reorg.reorg_trigger('INSERT INTO
reorg.log_16793623(pk, row) 
VALUES( CASE WHEN $1 IS NULL THEN NULL ELSE
(ROW($1.sequence_id)::reorg.pk_16793623) END, $2)');

CREATE FUNCTION reorg_trigger() RETURNS trigger
    LANGUAGE c STRICT SECURITY DEFINER
    AS '$libdir/pg_reorg', 'reorg_trigger';

when i checked  this  belonged to pg_reorg, but i do not understand why this
error was coming


Rgrds
Suhas





--
View this message in context: http://postgresql.1045698.n5.nabble.com/PG-REORG-ISSUE-tp5733850.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (2+ messages)  latest in thread

Message-ID: <1354081025812-5733850.post@n5.nabble.com>
Permalink:  ../1354081025812-5733850.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1354081025812-5733850.post@n5.nabble.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: suhas.b@verse.in
  Subject: Re: PG_REORG ISSUE
  In-Reply-To: <1354081025812-5733850.post@n5.nabble.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