How does postgres remain the unique index unique?

From: zhuangjifeng <zhuangjifeng(at)263(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How does postgres remain the unique index unique?
Date: 2004-04-30 04:59:09
Message-ID: 20040430045858.999411D5E8@smtp.263.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<html><pre><PRE><HTML><PRE><PRE>Hello,<BR><!-- -->everyone,<BR><!-- --> I want to know how postgres remain its unique index unique after i have change it,For<BR><!-- -->example:<BR><!-- --> CREATE TABLE human(age INT,name CHAR(30));<BR><!-- -->then in pg_attribute catalog the unique index pg_attribute_relid_attnum_index will use the relid of<BR><!-- -->'human' and attnum of age to create a index tuple for attribute:age,which is a unique index tuple describing<BR><!-- -->age ,then i do:<BR><!-- --> ALTER TABLE human RENAME age TO birthdate;<BR><!-- -->in the unique index pg_attribute_relid_attnum_index will appear two index tuple which keys are relid of 'human'<BR><!-- -->and attnum:1 to describe age(In my mind,when insert or update a heap tuple,postgres only inserts a new index <BR><!-- -->tuple for it in its index relation if it has not delete or tag the old index tuple),but there is no error<BR><!-- -->happening!!!!So i am interested in the method of remianing the dynamic index unique very much.<BR><!-- --> would you please tell me how postgres completes it and the src of this?<BR><!-- -->thank:)<BR><!-- --> 庄继锋 <BR><!-- --> 2004-4-30</PRE></PRE>

==========================
263电子邮件-信赖邮自专业</PRE></pre></html>

==========================
263电子邮件-信赖邮自专业

Attachment Content-Type Size
unknown_filename text/html 1.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-04-30 05:11:12 Re: Call for 7.5 feature completion
Previous Message Marc G. Fournier 2004-04-30 04:58:21 Re: Call for 7.5 feature completion