pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chris <chrisk@pgsqlrocket.com>
To: pgsql-general@postgresql.org
Subject: plpgsql function-parsing
Date: Tue, 6 Mar 2018 08:51:08 -0700
Message-ID: <d24066d1-a3b6-89a2-bb20-beaa92f98405@pgsqlrocket.com> (raw)

Hi,

I am trying to create a function that gets passed a statement as a 
string and then I need to change the table_name within the string by 
adding a "_cdc" to it, then execute the statement

ex:

string passed could be GRANT all ON authors TO bob.

then

EXECUTE GRANT all ON authors_cdc TO bob


I'm looking into parsing the string but i can't find a way to parse in a 
way that'll work. Any ideas?


Thanks,

Chris





view thread (2+ messages)  latest in thread

Message-ID: <d24066d1-a3b6-89a2-bb20-beaa92f98405@pgsqlrocket.com>
Permalink:  ../d24066d1-a3b6-89a2-bb20-beaa92f98405@pgsqlrocket.com/
Also on:    postgresql.org/message-id/d24066d1-a3b6-89a2-bb20-beaa92f98405@pgsqlrocket.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: chrisk@pgsqlrocket.com
  Subject: Re: plpgsql function-parsing
  In-Reply-To: <d24066d1-a3b6-89a2-bb20-beaa92f98405@pgsqlrocket.com>
  References: <d24066d1-a3b6-89a2-bb20-beaa92f98405@pgsqlrocket.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