Skip site navigation (1) Skip section navigation (2)

Fwd: Re: Table partititon hakkında soru

From: Timu <timu(at)cetech(dot)biz>
To: pgsql-tr-genel(at)postgresql(dot)org
Subject: Fwd: Re: Table partititon hakkında soru
Date: 2007-10-04 15:56:47
Message-ID: 200710041856.50140.timu@cetech.biz (view raw or flat)
Thread:
Lists: pgsql-tr-genel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On Thursday 04 October 2007 18:25:07 you wrote:
> Merhaba,
>
> On Thu, 2007-10-04 at 18:19 +0300, Timu wrote:
> > partition tablolarda bulunan check constraintler'in  kullandığı
> > fieldler üzerinde update işlemi gerçekleştiremiyorum
>
> Check constraintler UPDATE RESTRICT ile tanımlanmış olabilir mi?
>
> Bkz:
>
> http://www.gunduz.org/download.php?dlid=25
>
> Kolay gelsin,

Açıkcası her hangi bir durum belirtmedim. Yaptığım işlemleri sıra ile
veriyorum.

create table test(id bigserial not null, i integer not null);

create table test_1 (check(i = 1)) inherits(test);
create table test_2 (check(i = 2)) inherits(test);
create table test_3 (check(i = 3)) inherits(test);

create or replace rule test_1_rule AS ON INTSERT TO test WHERE (i = 1) DO
INSTEAD INSERT INTO test_1 (NEW.id, NEW.i);

create or replace rule test_2_rule AS ON INSERT TO test WHERE (i = 2) DO
INSTEAD INSERT INTO test_2 VALUES (NEW.id, NEW.i);


create or replace rule test_3_rule AS ON INSERT TO test WHERE (i = 3) DO
INSTEAD INSERT INTO test_3 VALUES (NEW.id, NEW.i);

insert into test (i) values (1);
insert into test (i) values (2);
insert into test (i) values (3);

select * from test;
 id | i
- - ----+---
  1 | 1
  2 | 2
  3 | 3
(3 rows)

anager=# select * from test_1;
 id | i
- - ----+---
  1 | 1
(1 row)

select * from test_2;
 id | i
- - ----+---
  2 | 2


select * from test_3;
 id | i
- - ----+---
  3 | 3

manager=# update test set i=1 where id=2;
ERROR:  new row for relation "test_2" violates check
constraint "test_2_i_check"
manager=#


Not: Devrim bey kusura bakmayın shortcut'ların kurbanı oldum (2 kez)..


- -- 
Timu EREN <timu(at)cetech(dot)biz>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHBQ1CcubzCFA5PLsRAr2eAJ9CvI6B6taWWfbBXQ983xU5MJMBpQCfWHT0
WJ8IaIQOxP+/loIAfuomvTo=
=KtzB
-----END PGP SIGNATURE-----

pgsql-tr-genel by date

Next:From: TimuDate: 2007-10-04 16:12:34
Subject: Re: Table partititon hakkında soru
Previous:From: TimuDate: 2007-10-04 15:54:24
Subject: Re: Table partititon hakkında soru

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group