Re: Compatibility types, type aliases, and distinct types
От | Asko Oja |
---|---|
Тема | Re: Compatibility types, type aliases, and distinct types |
Дата | |
Msg-id | ecd779860808180550y7b137e9ax280c05275dc377c9@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Compatibility types, type aliases, and distinct types (Stephen Frost <sfrost@snowman.net>) |
Список | pgsql-hackers |
<div dir="ltr">In my experience synonyms as well as rules are hacks and should be avoided althou there are cases where theycan save some work for dba's during transitions from one situation to better one.<br /><br />> There is also anotherpossible way one might want to create a compatibility<br /> > type. Instead of creating a new type, create analias for an existing type,<br /> > much like we currently have built-in mappings for int -> int4, bigint -><br/> > int8, etc. The difference here is that the type you put in is not the same<br /> > as the one you getdumped out. So depending on taste and requirements, a<br /> > user might want to choose the distinct type or the aliasroute.<br /><br />Example or two would be helpful here where you expect this kind of functionality be useful. Couldyou use it for defining Oracle compatibel varchar2 and how would it work then?<br /><br /><div class="gmail_quote">OnMon, Aug 18, 2008 at 3:33 PM, Stephen Frost <span dir="ltr"><<a href="mailto:sfrost@snowman.net">sfrost@snowman.net</a>></span>wrote:<br /><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">* PeterEisentraut (<a href="mailto:peter_e@gmx.net">peter_e@gmx.net</a>) wrote:<br /> > There is also another possible wayone might want to create a compatibility<br /> > type. Instead of creating a new type, create an alias for an existingtype,<br /> > much like we currently have built-in mappings for int -> int4, bigint -><br /> > int8,etc. The difference here is that the type you put in is not the same<br /> > as the one you get dumped out. Sodepending on taste and requirements, a<br /> > user might want to choose the distinct type or the alias route.<br /><br/></div>The alias route gets me thinking about Oracle synonyms.. That'd be nice<br /> to have in PG for a number ofobject types. Most recently I was wishing<br /> I could create a schema synonym, though being able to do tables/views<br/> would have worked as well in that case, just a bit more work.<br /><div class="Ih2E3d"><br /> > Whatdo you think about adding this kind of support to PostgreSQL? Obviously,<br /> > some details need to be worked out,but most of this is actually<br /> > straightforward catalog manipulation.<br /><br /></div>I like the concept. Notsure how much I'd end up using it, personally.<br /><br /> Thanks,<br /><font color="#888888"><br /> Stephen<br /></font><br />-----BEGIN PGP SIGNATURE-----<br /> Version: GnuPG v1.4.9 (GNU/Linux)<br /><br /> iEYEARECAAYFAkipbCgACgkQrzgMPqB3kiinmwCfROrhdu8YDpzsJvOtvpSW147O<br/> SOQAn3y/4MGadFz9VqDsmcm8fiKuxsn5<br /> =gdfU<br />-----END PGP SIGNATURE-----<br /><br /></blockquote></div><br /></div>
В списке pgsql-hackers по дате отправления: