Hi All,
I am currently using PostgreSQL 8.1.3 and am trying to create an
updatable view with two (or more) joined tables and I also would like to
have the ability to indicate implicitly the value of the serial primary
key fields.
I have the following two tables:
CREATE TABLE purchase (
pu
On Tue, May 16, 2006 at 04:16:55PM +0300, Kouber Saparev wrote:
> The tricky part comes when I try to make my view insertable. Normally
> I'd insert without specifying the sequence values, but in some cases I'd
> want also to have full control of what's going into the underlying
> tables. The th
Jim C. Nasby wrote:
On Tue, May 16, 2006 at 04:16:55PM +0300, Kouber Saparev wrote:
The tricky part comes when I try to make my view insertable. Normally
I'd insert without specifying the sequence values, but in some cases I'd
want also to have full control of what's going into the underlying
On Mon, May 22, 2006 at 10:30:47PM +0300, Kouber Saparev wrote:
> Jim C. Nasby wrote:
> >On Tue, May 16, 2006 at 04:16:55PM +0300, Kouber Saparev wrote:
> >>The tricky part comes when I try to make my view insertable. Normally
> >>I'd insert without specifying the sequence values, but in some case
Jim C. Nasby wrote:
I think you could get away with doing a CASE or COALESCE statement, ie:
INSERT INTO subscription_purchase ... SELECT
COALESCE(currval('purchase_purchase_sid_seq'), NEW.purchase_sid)
BTW, it would be interesting to share whatever you finally come up with;
it's an interesting