pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Browne <cbbrowne@acm.org>
To: pgsql-sql@postgresql.org
Subject: Re: Good examples of calling slony stored procedures
Date: Wed, 14 Jun 2006 16:55:14 -0400
Message-ID: <877j3jcv9p.fsf@wolfe.cbbrowne.com> (raw)
References: <20060614155251.M20704@contactbda.com>
	<7E875A718407634584849D1C0A16295D01346215@sanusexch1.atitech.com>

Martha Stewart called it a Good Thing when markadan@ati.com ("Mark Adan") wrote:
> I looked there already and didn't find what I needed.  I saw this web
> page from cbbrowne and he briefly talked about using "bare metal" slony
> functions, but doesn't have any examples.

If you look at the source code for the slonik utility, it shows how
the functions actually get used.

In most cases, slonik.c submits fairly simple requests using the
functions in slony1-funcs.sql.

For instance, the slonik MOVE SET (id=1, old origin=11, new origin=22);
command runs a bunch of C "deteriorata" that is a wrapper for:

   select _slony_schema.moveset(1, 22);

Plenty of the commands are about as simple as that.

And this means that, for these "simple" operations, if you want to
submit them via SQL queries, there's a very thin veiling you need to
do to submit the functions as SQL selects.

There are more complex cases, such as FAIL OVER, SET ADD TABLE,
EXECUTE SCRIPT, UPDATE FUNCTIONS, and WAIT FOR EVENT, where there is
considerably complex logic in addition to what is in the stored procs.

Looking at slonik.c is the best thing I can suggest you do...
-- 
"cbbrowne","@","cbbrowne.com"
http://linuxdatabases.info/info/x.html
Signs  of a   Klingon  Programmer  #6: "Debugging?   Klingons  do  not
debug. Our software does not coddle the weak."



view thread (8+ messages)

Message-ID: <877j3jcv9p.fsf@wolfe.cbbrowne.com>
Permalink:  ../877j3jcv9p.fsf@wolfe.cbbrowne.com/
Also on:    postgresql.org/message-id/877j3jcv9p.fsf@wolfe.cbbrowne.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-sql@postgresql.org
  Cc: cbbrowne@acm.org
  Subject: Re: Good examples of calling slony stored procedures
  In-Reply-To: <877j3jcv9p.fsf@wolfe.cbbrowne.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