Обсуждение: ALTER TYPE my_enum AS ENUM ADD ('label10')
Hi all,
I start working with enumerator types and I am wondering, if my enumerator can later be adjusted. E.g. if I would like to add another label.
Is it allowed just to add another entry to pg_enum? How is the enumerator then sorted (i.e. enum_last() )?
Is it possible to alter the labels of an enumerator later on? Can I edit pg_enum?
Thanks already,
Andreas Gaab
___________________________________________________________________________
SCANLAB AG
Dr. Andreas Simon Gaab
Entwicklung • R & D
Siemensstr. 2a • 82178 Puchheim • Germany
Tel. +49 (89) 800 746-513 • Fax +49 (89) 800 746-199
mailto:a.gaab@scanlab.de • www.scanlab.de
Amtsgericht München: HRB 124707 • USt-IdNr.: DE 129 456 351
Vorstand: Georg Hofner (Sprecher), Christian Huttenloher, Norbert Petschik
Aufsichtsrat (Vorsitz): Dr. Hans J. Langer
___________________________________________________________________________
In response to Andreas Gaab : > Hi all, > > > > I start working with enumerator types and I am wondering, if my enumerator can > later be adjusted. E.g. if I would like to add another label. AFAIK you can't. Each enum is a own type. Use a lookup-table instead and use enum's only for real static things. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
In response to Andreas Gaab : > I tried successfully to directly insert a further entry into table > pg_enum with the corresponding enumtypid. Do you think to directly > manipulate table pg_enum is allowed? It's maybe allowed, but not recommended. It's a system-table, not a user-table. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99