Обсуждение: CREATE TYPE
Can someone point me at some detailed instructions for creating new datatypes.. I've found quite a few web pages that mention it (in passing) and give brief examples - but nothing much I can actually work with for my purposes.. Ideally I'd like to use C as the language and the datatype will need an 'extent' (like 'char' can be char(10) - although its nothing like a char field...) I'm targetting this at the new 7.4 - so I think i need to use 'version 1' method (using Datum etc ?) Also - the datatype itself is a comlex type which stores half a dozen different integers (Its a modified datetime - storing the year, month, day, hour, minute, second, but the extent gives it the ability to do YEAR TO DAY, HOUR TO SECOND etc, so you only get/set the relevant sections). When 'selected' it would return a variable length string containing the relevant data, and would be set by passing in a string (some of the data of which may well be ignored if its outside the extent of the column etc) Hope thats enough - all pointers greatfully received.. (and free'd when required :)
Programmers Guide , Chap 10 http://www.postgresql.org/docs/7.3/static/xtypes.html contrib/isbn_issn also provides an implementation example. regds mallah. > Can someone point me at some detailed instructions for creating new > datatypes.. > > I've found quite a few web pages that mention it (in passing) and give > brief examples - but nothing much I can actually work with for my > purposes.. > > Ideally I'd like to use C as the language and the datatype will need an > 'extent' (like 'char' can be char(10) - although its nothing like a > char field...) > > I'm targetting this at the new 7.4 - so I think i need to use 'version > 1' method (using Datum etc ?) > > Also - the datatype itself is a comlex type which stores half a dozen > different integers (Its a modified datetime - storing the year, month, > day, hour, minute, second, but the extent gives it the ability to do > YEAR TO DAY, HOUR TO SECOND etc, so you only get/set the relevant > sections). > When 'selected' it would return a variable length string containing the > relevant data, and would be set by passing in a string (some of the > data of which may well be ignored if its outside the extent of the > column etc) > > Hope thats enough - all pointers greatfully received.. > (and free'd when required :) > > > > ---------------------------(end of > broadcast)--------------------------- TIP 3: if posting/reading through > Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly ----------------------------------------- Over 1,00,000 exporters are waiting for your order! Click below to get in touch with leading Indian exporters listed in the premier trade directory Exporters Yellow Pages. http://www.trade-india.com/dyn/gdh/eyp/
OK - i've got the basic input/output working now - but how to I do the extent bit ? eg. allow : create table (something a4gl_datime(15) ) On Friday 18 July 2003 6:53 pm, mallah@trade-india.com wrote: > Programmers Guide , Chap 10 > http://www.postgresql.org/docs/7.3/static/xtypes.html > > contrib/isbn_issn also provides an implementation example. > > regds > mallah. > > > Can someone point me at some detailed instructions for creating new > > datatypes.. > > > > I've found quite a few web pages that mention it (in passing) and give > > brief examples - but nothing much I can actually work with for my > > purposes.. > > > > Ideally I'd like to use C as the language and the datatype will need an > > 'extent' (like 'char' can be char(10) - although its nothing like a > > char field...) > > > > I'm targetting this at the new 7.4 - so I think i need to use 'version > > 1' method (using Datum etc ?) > > > > Also - the datatype itself is a comlex type which stores half a dozen > > different integers (Its a modified datetime - storing the year, month, > > day, hour, minute, second, but the extent gives it the ability to do > > YEAR TO DAY, HOUR TO SECOND etc, so you only get/set the relevant > > sections). > > When 'selected' it would return a variable length string containing the > > relevant data, and would be set by passing in a string (some of the > > data of which may well be ignored if its outside the extent of the > > column etc) > > > > Hope thats enough - all pointers greatfully received.. > > (and free'd when required :) > > > > > > > > ---------------------------(end of > > broadcast)--------------------------- TIP 3: if posting/reading through > > Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that your > > message can get through to the mailing list cleanly > > ----------------------------------------- > Over 1,00,000 exporters are waiting for your order! Click below to get > in touch with leading Indian exporters listed in the premier > trade directory Exporters Yellow Pages. > http://www.trade-india.com/dyn/gdh/eyp/ > > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend
sorry i was not the rite person to answer at the first place.wait for other hacker to help ya. regds mallah. > OK - i've got the basic input/output working now - but how to I do the > extent bit ? > eg. allow : > > create table ( > something a4gl_datime(15) > ) > > > On Friday 18 July 2003 6:53 pm, mallah@trade-india.com wrote: >> Programmers Guide , Chap 10 >> http://www.postgresql.org/docs/7.3/static/xtypes.html >> >> contrib/isbn_issn also provides an implementation example. >> >> regds >> mallah. >> >> > Can someone point me at some detailed instructions for creating new >> > datatypes.. >> > >> > I've found quite a few web pages that mention it (in passing) and >> > give brief examples - but nothing much I can actually work with for >> > my purposes.. >> > >> > Ideally I'd like to use C as the language and the datatype will need >> > an >> > 'extent' (like 'char' can be char(10) - although its nothing like a >> > char field...) >> > >> > I'm targetting this at the new 7.4 - so I think i need to use >> > 'version 1' method (using Datum etc ?) >> > >> > Also - the datatype itself is a comlex type which stores half a >> > dozen different integers (Its a modified datetime - storing the >> > year, month, day, hour, minute, second, but the extent gives it the >> > ability to do YEAR TO DAY, HOUR TO SECOND etc, so you only get/set >> > the relevant sections). >> > When 'selected' it would return a variable length string containing >> > the >> > relevant data, and would be set by passing in a string (some of the >> > data of which may well be ignored if its outside the extent of the >> > column etc) >> > >> > Hope thats enough - all pointers greatfully received.. >> > (and free'd when required :) >> > >> > >> > >> > ---------------------------(end of >> > broadcast)--------------------------- TIP 3: if posting/reading >> > through Usenet, please send an appropriate >> > subscribe-nomail command to majordomo@postgresql.org so that >> > your message can get through to the mailing list cleanly >> >> ----------------------------------------- >> Over 1,00,000 exporters are waiting for your order! Click below to get >> in touch with leading Indian exporters listed in the premier >> trade directory Exporters Yellow Pages. >> http://www.trade-india.com/dyn/gdh/eyp/ >> >> >> >> ---------------------------(end of >> broadcast)--------------------------- TIP 8: explain analyze is your >> friend > > > ---------------------------(end of > broadcast)--------------------------- TIP 3: if posting/reading through > Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly ----------------------------------------- Over 1,00,000 exporters are waiting for your order! Click below to get in touch with leading Indian exporters listed in the premier trade directory Exporters Yellow Pages. http://www.trade-india.com/dyn/gdh/eyp/