Thread

  1. help with creating an opclass for a new data type

    Jeff Hoffmann <jeff@remapcorp.com> — 1998-08-06T18:00:24Z

    i've created a simple phone number data type to simplify and standardize
    input/output of phone numbers and also allow for comparisons of 7 digit and
    10 digit phone numbers that make more sense (a phone number without an area
    code is equal to that number in every area code, as far as i'm concerned).
    this is my first attempt at creating my own type and after looking at and
    hacking up other contributed code, i've figured out enough to get this
    working fairly well.
    
    that was the easy part.  now i want to make an op class so i can index the
    field.  again, after looking through and hacking the sql script for another
    contributed data type, i thought i had everything set up right.  i'm able to
    create the index just fine (i think -- it doesn't give me any error
    messages), but any time i do a select that can take advantage of the index,
    i got the following error:
    
    postgres=> select * from test_numbers where pn='659-9232';
    ERROR:  fmgr_info: function 0: cache lookup failed
    
    i looked throught the mail lists, but i'm still not quite sure what this
    message means.  can some one tell me what this message means?  i'll attach
    the files that i'm using to do create and test it.  it's a fairly small
    file, so i hope it's not too disruptive for the list.
    
    thanks,
    
    jeff
    jeff@remapcorp.com