pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc G. Fournier <scrappy@hub.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: simple trigger question ...
Date: Thu, 3 Apr 2003 00:31:20 -0400 (AST)
Message-ID: <20030403002922.Y71125@hub.org> (raw)
In-Reply-To: <25512.1049343373@sss.pgh.pa.us>
References: <20030402223933.M71125@hub.org>
	<25296.1049341477@sss.pgh.pa.us>
	<20030403000605.U71125@hub.org>
	<25512.1049343373@sss.pgh.pa.us>


Okay, so I do have to create the FUNCTION first, I can't do it without?
Can a TRIGGER pass an arg to the FUNCTION?

On Wed, 2 Apr 2003, Tom Lane wrote:

> "Marc G. Fournier" <scrappy@hub.org> writes:
> >> Er ... you just want to bump the sequence and throw away the actual
> >> value?  You don't want to store the value somewhere?
>
> > Correct
>
> Then you need something like (untested)
>
> CREATE FUNCTION mytrig() RETURNS TRIGGER AS '
> begin
>   perform nextval(''seq'');
>   return new;
> end' LANGUAGE plpgsql;
>
> 			regards, tom lane
>




view thread (10+ messages)  latest in thread

Message-ID: <20030403002922.Y71125@hub.org>
Permalink:  ../20030403002922.Y71125@hub.org/
Also on:    postgresql.org/message-id/20030403002922.Y71125@hub.org

 · 

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: scrappy@hub.org, tgl@sss.pgh.pa.us
  Subject: Re: simple trigger question ...
  In-Reply-To: <20030403002922.Y71125@hub.org>

* 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