Re: [HACKERS] Re: [GENERAL] Update of bitmask type
От | Adriaan Joubert |
---|---|
Тема | Re: [HACKERS] Re: [GENERAL] Update of bitmask type |
Дата | |
Msg-id | 37FF095A.7DC0841B@albourne.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] Re: [GENERAL] Update of bitmask type (Bruce Momjian <maillist@candle.pha.pa.us>) |
Ответы |
Re: [HACKERS] Re: [GENERAL] Update of bitmask type
Re: [HACKERS] Re: [GENERAL] Update of bitmask type |
Список | pgsql-hackers |
Hi, OK, I've finally gotten round to coding most of the functions for bit strings. I've got I/O, concatenation, substring and all bit operations (and, or, xor, not, shift) working on the bitstring data structures. A few (probably pretty daft) questions (if there is documentation on this somewhere, please point me to it): 1. In the varchar file there are some functions which I believe are for the conversion of char(n) to char(m). They take as argument a pointer to a char() and a len which is the length of the total data structure. I haven't figured out how conversions are implemented within postgres, but I would need to transfer the equivalent of an atttypmod value, which would contain the length of the bit string to do the conversions. Does this fit in with the way the rest of the system works? char * zpbit (char * arg, int32 bitlen) 2. there is a function _bpchar, which has something to do with arrays, but I can't see how it fits in with everything else. 3. I need to write a hash function for bitstrings. I know nothing about hash functions, except that they are hard to do well. I looked at the function for text hashes and that is some weird code (i.e. it took me a while to figure out what it did). Does anybody have any suggestions off-hand for a decent hash function for bit strings? Could I just use the text hash function? (Seems to me text should be different as it usually draws from a more restricted range than a bit string). 4. Now that I've got the functionality, can somebody give me a rough roadmap to what I need to change to turn this into a proper postgres type? As far as I can see I need to assign oid's to it in pg_type.h and I'll have to have a look at the parser to get it to recognise the types. It would be a big help though if somebody could tell me what else needs to change. Thanks, Adriaan
В списке pgsql-hackers по дате отправления: