Обсуждение:
<pre><pre>hello,<br />everyone!<br /> I want to know how postgresql remain its unique index unique after <br />i have changeit.For example:<br /> create table human(age int,name char(2));<br />then in the pg_attribute catalog the unique indexpg_attribute_relid_attnum_index will<br />use relid of 'human'and attnum of age to create a index tuple for attribute:age,whichis a unique index tuple for a tuple which describe age in pg_attribute,and i do:<br /> alter table humanrename 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 interestedin the method of remain the dynamic index very much.<br /> would you please tell how postgres do it and the srcof this? <br />thanks :) </pre><pre> </pre><pre> 致<br />礼!<br /> </pre><pre> 庄继锋<br /> <a href="mailto:zhuangjifeng@263.net">zhuangjifeng@263.net</a><br/> 2004-04-29</pre></pre> ==========================263电子邮件-信赖邮自专业
zhuangjifeng <zhuangjifeng@263.net> writes:
> PGh0bWw+PHByZT48UFJFPmhlbGxvLDxCUj5ldmVyeW9uZSE8QlI+Jm5ic3A7
> SSB3YW50IHRvIGtub3cgaG93IHBvc3RncmVzcWwgcmVtYWluIGl0cyB1bmlx
> dWUgaW5kZXggdW5pcXVlIGFmdGVyIDxCUj5pIGhhdmUgY2hhbmdlIGl0LkZv
> ciBleGFtcGxlOjxCUj4mbmJzcDtjcmVhdGUgdGFibGUgaHVtYW4oYWdlIGlu
> dCxuYW1lIGNoYXIoMikpOzxCUj50aGVuIGluIHRoZSBwZ19hdHRyaWJ1dGUg
> Y2F0YWxvZyB0aGUgdW5pcXVlIGluZGV4IHBnX2F0dHJpYnV0ZV9yZWxpZF9h
> dHRudW1faW5kZXggd2lsbDxCUj51c2UgcmVsaWQgb2YgJ2h1bWFuJ2FuZCBh
> dHRudW0gb2YgYWdlIHRvIGNyZWF0ZSBhIGluZGV4IHR1cGxlIGZvciBhdHRy
> aWJ1dGU6YWdlLHdoaWNoIGlzIGEgdW5pcXVlIGluZGV4IHR1cGxlIGZvciBh
> IHR1cGxlIHdoaWNoIGRlc2NyaWJlIGFnZSBpbiBwZ19hdHRyaWJ1dGUsYW5k
> IGkgZG86PEJSPiZuYnNwO2FsdGVyIHRhYmxlIGh1bWFuIHJlbmFtZSBhZ2Ug
> dG8gYmlydGhkYXRlOzxCUj50aGVuIGluIHRoZSB1bmlxdWUgaW5kZXggcGdf
> YXR0cmlidXRlX3JlbGlkX2F0dG51bV9pbmRleCB3aWxsIGFwcGVhciB0d28g
> aW5kZXggdHVwbGUgPEJSPndoaWNoIGtleXMgYXJlIHJlbGlkIG9mICdodW1h
> bicgYW5kIGF0dG51bToxIHRvIGRlc2NyaWJlIGFnZSAsYnV0IHRoZXJlIGlz
> IG5vIGVycm9yIGhhcHBlbmluZyEhISFTbyBpIGFtIGludGVyZXN0ZWQgaW4g
> dGhlIG1ldGhvZCBvZiByZW1haW4gdGhlIGR5bmFtaWMgaW5kZXggdmVyeSBt
> dWNoLjxCUj4mbmJzcDt3b3VsZCB5b3UgcGxlYXNlIHRlbGwgaG93IHBvc3Rn
> cmVzIGRvIGl0IGFuZCB0aGUgc3JjIG9mIHRoaXM/IDxCUj50aGFua3MgOikg
> PC9QUkU+PFBSRT4mbmJzcDs8L1BSRT48UFJFPqGhoaGhoaGhoaGhoaGhoaHW
> wjxCUj7A8aOhPEJSPiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOzwv
> UFJFPjxQUkU+oaGhoaGhoaGhoaGhoaGhodevvMy35jxCUj6hoaGhoaGhoaGh
> oaGhoaGhPEEgaHJlZj0ibWFpbHRvOnpodWFuZ2ppZmVuZ0AyNjMubmV0Ij56
> aHVhbmdqaWZlbmdAMjYzLm5ldDwvQT48QlI+oaGhoaGhoaGhoaGhoaGhoaGh
> 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