From: | "Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com> |
---|---|
To: | PostgreSQL-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Strange behaviour of RULE (selecting last inserted ID of 'sequenced' column) |
Date: | 2006-07-13 14:15:39 |
Message-ID: | e431ff4c0607130715u39894e48qb3011a3a3b2d6038@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs pgsql-general |
Is this a bug?
test=> create sequence strange_seq;
CREATE SEQUENCE
test=> create table strange(id integer not null default
nextval('strange_seq') primary key, data text);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"strange_pkey" for table "strange"
CREATE TABLE
test=> create rule strange_rule as on insert to strange do select new.id as id;
CREATE RULE
test=> insert into strange(data) values('adas');
id
----
2
(1 row)
test=> select * from strange;
id | data
----+------
1 | adas
(1 row)
test=> insert into strange(data) values('adas');
id
----
4
(1 row)
test=> insert into strange(data) values('adas');
id
----
6
(1 row)
test=> select * from strange;
id | data
----+------
1 | adas
3 | adas
5 | adas
(3 rows)
--
Best regards,
Nikolay
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-07-14 01:08:19 | Re: BUG #2516: group privs do not seem to be honored |
Previous Message | Dusan Halicky | 2006-07-13 14:02:27 | BUG #2530: Some columns not visible when select from table (via odbc only) |
From | Date | Subject | |
---|---|---|---|
Next Message | Leonard, Arah | 2006-07-13 14:45:29 | Windows Local Security Policy Rights? |
Previous Message | Richard Broersma Jr | 2006-07-13 14:11:55 | Re: VPD |