Thread: cache question

cache question

From
Bruce Momjian
Date:
Can someone explain why there are two network_ops in the pg_opclass
table?  I am trying to make pg_opclass unique.  We have a cache on
pg_opclass.opcname, so we clearly have a problem here.  

Also, is it safe to set opcdeftype to a non-zero value so I can make
that index unique too?

This stuff confusing.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] cache question

From
Bruce Momjian
Date:
> Can someone explain why there are two network_ops in the pg_opclass
> table?  I am trying to make pg_opclass unique.  We have a cache on
> pg_opclass.opcname, so we clearly have a problem here.  
> 
> Also, is it safe to set opcdeftype to a non-zero value so I can make
> that index unique too?
> 
> This stuff confusing.

Looks like I fixed it.  I made on inet_ops and the other cidr_ops. 
Those names should be unique in there anyway.  They are just used when
specifying the ops on an index create.  The zero entries I just set to
dummy values for int24 and int42 because there are no type that match
them.  I set their typedef to be the same as the ops oid.  Hope the
sanity check doesn't complain.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] cache question

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Can someone explain why there are two network_ops in the pg_opclass
> table?

Looks like one is for type inet and the other for type cidr.  I'm
still confused about the difference between the two types (hey,
I ain't Paul Vixie) but I suspect we don't really need two entries
in pg_opclass for them --- the types are binary-equivalent according
to parse_coerce.h.  If we do need two entries, they should be given
different names.

> This stuff confusing.

It's 1:30AM EST ... way past time to be doing serious work, at least
in this time zone ...
        regards, tom lane


Re: [HACKERS] cache question

From
Bruce Momjian
Date:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Can someone explain why there are two network_ops in the pg_opclass
> > table?
> 
> Looks like one is for type inet and the other for type cidr.  I'm
> still confused about the difference between the two types (hey,
> I ain't Paul Vixie) but I suspect we don't really need two entries
> in pg_opclass for them --- the types are binary-equivalent according
> to parse_coerce.h.  If we do need two entries, they should be given
> different names.

Done.  That's how I did it.

> > This stuff confusing.
> 
> It's 1:30AM EST ... way past time to be doing serious work, at least
> in this time zone ...

Yes, I wanted to get it working.  Seems like it works now.  Will commit
soon.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026