Re: Rules, views, sequences and returned values

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "DaVinci" <bombadil(at)wanadoo(dot)es>
Cc: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Rules, views, sequences and returned values
Date: 2001-03-23 14:53:49
Message-ID: 004401c0b3a9$13ef51f0$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I have a table and want to make a view updateable with rules. Table has a
> sequence that creates default value to primary key when inserting.
>
> And now the question: Is it posible to return value of primary key from
> rule of inserting with NEW? Is that value what i would get from extern
> calling to insert, instead of OID?.

SELECT currval('seq-table-name_seq-field-name_seq');

where seq-table-name is the name of your table (not the view), and
seq-field-name is the name of the primary key.

Greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-03-23 15:35:34 Re: Call for platforms
Previous Message DaVinci 2001-03-23 14:23:56 Rules, views, sequences and returned values