From: Rafael Domiciano <rafael.domiciano@gmail.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: c k <shreeseva.learning@gmail.com>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: Re: [GENERAL] Functions
Date: Tue, 30 Sep 2008 22:54:09 -0200
Message-ID: <3a0028490809301754h46458028v27877bfa7a665ee6@mail.gmail.com> (raw)
In-Reply-To: <dcc563d10809151057r3a76027ao562a79dc8c051fd2@mail.gmail.com>
References: <d8e7a1e30809150955v32f01897wa900261ac86af34b@mail.gmail.com>
<48CE9674.6020401@archonet.com>
<d8e7a1e30809151052m50c3b006s87698bd517db13f5@mail.gmail.com>
<d8e7a1e30809151053g5ce95e53m7621c017cd9adbe1@mail.gmail.com>
<dcc563d10809151057r3a76027ao562a79dc8c051fd2@mail.gmail.com>
Hello,
If you want to get the value of a autogenerated column it's better to use
"RETURNING"
insert into something returning primary key...
Best Regards,
Rafael Domiciano
Postgres DBA
2008/9/15 Scott Marlowe <scott.marlowe@gmail.com>
> On Mon, Sep 15, 2008 at 11:53 AM, c k <shreeseva.learning@gmail.com>
> wrote:
> >
> >
> > If I have a function having:
> > begin
> > insert into something ...
> > select max(primary key) from something..
> > end;
> >
> > does the second statement within a function can view the results after
> > execution of first statement to get max(P.K.)?
>
> Yep.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
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: rafael.domiciano@gmail.com, scott.marlowe@gmail.com, shreeseva.learning@gmail.com, dev@archonet.com, pgsql-general@postgresql.org
Subject: Re: [GENERAL] Functions
In-Reply-To: <3a0028490809301754h46458028v27877bfa7a665ee6@mail.gmail.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