No title

Started by zhuangjifengalmost 22 years ago2 messageshackers
Jump to latest
#1zhuangjifeng
zhuangjifeng@263.net

<html><pre><PRE>hello,<BR>everyone!<BR>&nbsp;I want to know how postgresql remain its unique index unique after <BR>i have change it.For example:<BR>&nbsp;create table human(age int,name char(2));<BR>then in the pg_attribute catalog the unique index pg_attribute_relid_attnum_index will<BR>use relid of 'human'and attnum of age to create a index tuple for attribute:age,which is a unique index tuple for a tuple which describe age in pg_attribute,and i do:<BR>&nbsp;alter table human rename age to birthdate;<BR>then in the unique index pg_attribute_relid_attnum_index will appear two index tuple <BR>which keys are relid of 'human' and attnum:1 to describe age ,but there is no error happening!!!!So i am interested in the method of remain the dynamic index very much.<BR>&nbsp;would you please tell how postgres do it and the src of this? <BR>thanks :) </PRE><PRE>&nbsp;</PRE><PRE>        致<BR>礼!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</PRE><PRE>        庄继锋<BR>        <A href="mailto:zhuangjifeng@263.net">zhuangjifeng@263.net</A><BR>          2004-04-29</PRE></pre></html>

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: zhuangjifeng (#1)
Re:

=?gb2312?B?emh1YW5namlmZW5n?= <zhuangjifeng@263.net> writes:

PGh0bWw+PHByZT48UFJFPmhlbGxvLDxCUj5ldmVyeW9uZSE8QlI+Jm5ic3A7
SSB3YW50IHRvIGtub3cgaG93IHBvc3RncmVzcWwgcmVtYWluIGl0cyB1bmlx
dWUgaW5kZXggdW5pcXVlIGFmdGVyIDxCUj5pIGhhdmUgY2hhbmdlIGl0LkZv
ciBleGFtcGxlOjxCUj4mbmJzcDtjcmVhdGUgdGFibGUgaHVtYW4oYWdlIGlu
dCxuYW1lIGNoYXIoMikpOzxCUj50aGVuIGluIHRoZSBwZ19hdHRyaWJ1dGUg
Y2F0YWxvZyB0aGUgdW5pcXVlIGluZGV4IHBnX2F0dHJpYnV0ZV9yZWxpZF9h
dHRudW1faW5kZXggd2lsbDxCU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oaGhoaGhoaGhoaGh
oaEyMDA0LTA0LTI5PC9QUkU+PC9wcmU+PC9odG1sPg0KDQoNCg0KDQoNCj09
PT09PT09PT09PT09PT09PT09PT09PT09DQoyNjO159fT08q8/qOt0MXAtdPK
19TXqNK1

I'd have answered this if my editor could quote it reasonably,
but I don't have the energy to deal with the above...

In future, please post to pghackers in plain text (lose the
HTML, too) and include a relevant Subject: line.

regards, tom lane