pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Michiel Lange <michiel@minas.demon.nl>
To: pgsql-sql@postgresql.org
Subject: Re: trying to learn plpqsql... so please forgive..
Date: Wed, 20 Nov 2002 08:49:50 -0800
Message-ID: <web-1834137@davinci.ethosmedia.com> (raw)
In-Reply-To: <5.1.0.14.0.20021120010436.00b4c920@192.168.1.3>

Michiel,

> Maybe this should be sent to novice... I was not certain, but if it
> should, please tell me so.

No need to apologise.   Novice would have been appropriate, but SQL is
OK too.

> When I do an 'INSERT INTO <table> VALUES <row1,row2,row3>'
> and on the table is a serial primary key named p_key.
> As I want this number to be auto-generated, but use it as a 'customer
> number', I want to create this function to return the value of this
> insert. I thought/hoped that this would work, but as there are some
> people dependant on this database, I dare not try out too much ;-)
> This would be the first time I used plpgsql, so I am not so certain
> about what I do.

Hmmm ... the trigger, as you've written it, won't work.   An INSERT
 trigger can modify the inserted data, or reject it, or update data in
other tables.  But it cannot return data to the screen.

Can you break down, in more detail, what you're *trying* to do?   It
can probably be done, but I'm still not clear on what you're
attempting.

-Josh Berkus




view thread (7+ messages)  latest in thread

Message-ID: <web-1834137@davinci.ethosmedia.com>
Permalink:  ../web-1834137@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-1834137@davinci.ethosmedia.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: josh@agliodbs.com, michiel@minas.demon.nl
  Subject: Re: trying to learn plpqsql... so please forgive..
  In-Reply-To: <web-1834137@davinci.ethosmedia.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