{"Entry":{"collection":"opclass","key":"family-btree-bpchar_pattern_ops","name":"btree/bpchar_pattern_ops (family)","aliases":["bpchar_pattern_ops","btree/bpchar_pattern_ops"],"metadata":{"aliases":["bpchar_pattern_ops","btree/bpchar_pattern_ops"],"category":"B-tree families","content_hash":"014dcc1106d6c603abdb991b1d2e927a20dd780d88f98040286600563abfba8c","imported_at":"2026-09-30T00:40:39.555217+08:00","name":"btree/bpchar_pattern_ops (family)","name_zh":"","slug":"family-btree-bpchar_pattern_ops","summary":"B-tree operator family containing 1 classes, 5 operator strategies and 3 support functions in this source build."}},"Definition":{"Collection":"opclass","Key":"family-btree-bpchar_pattern_ops","SourceDatabase":"center","Version":"18","SourceTable":"operator_class","SourceKey":"family-btree-bpchar_pattern_ops","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"aliases":["bpchar_pattern_ops","btree/bpchar_pattern_ops"],"classes":[{"default":"f","family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","input_type":"bpchar","key_type":"none","method":"btree","name":"bpchar_pattern_ops","slug":"class-btree-bpchar_pattern_ops","source_oid":"4219"}],"comparison_data":{"attributes":{"method":"btree","name":"bpchar_pattern_ops"},"classes":[{"default":"f","family":"bpchar_pattern_ops","input_type":"bpchar","key_type":"none","method":"btree","name":"bpchar_pattern_ops"}],"kind":"family","operators":[{"family":"bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003c~(bpchar,bpchar)","purpose":"search","right_type":"bpchar","sort_family":"","strategy":"1"},{"family":"bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003c=~(bpchar,bpchar)","purpose":"search","right_type":"bpchar","sort_family":"","strategy":"2"},{"family":"bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"=(bpchar,bpchar)","purpose":"search","right_type":"bpchar","sort_family":"","strategy":"3"},{"family":"bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003e=~(bpchar,bpchar)","purpose":"search","right_type":"bpchar","sort_family":"","strategy":"4"},{"family":"bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003e~(bpchar,bpchar)","purpose":"search","right_type":"bpchar","sort_family":"","strategy":"5"}],"support_functions":[{"family":"bpchar_pattern_ops","function":"btbpchar_pattern_cmp(bpchar,bpchar)","left_type":"bpchar","method":"btree","number":"1","result_type":"int4","right_type":"bpchar"},{"family":"bpchar_pattern_ops","function":"btbpchar_pattern_sortsupport(internal)","left_type":"bpchar","method":"btree","number":"2","result_type":"void","right_type":"bpchar"},{"family":"bpchar_pattern_ops","function":"btequalimage(oid)","left_type":"bpchar","method":"btree","number":"4","result_type":"bool","right_type":"bpchar"}]},"comparison_hash":"b8579029c178fff59d371ac456c6b59aeb460700d93e8c16db03949a2f13ed38","description":["B-tree operator family containing 1 classes, 5 operator strategies and 3 support functions in this source build."],"facts":[{"label":"Object kind","value":"Operator family"},{"label":"Index AM","value":"B-tree"}],"family":{"method":"btree","name":"bpchar_pattern_ops"},"operators":[{"description":"less than","family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003c~(bpchar,bpchar)","operator_slug":"op-7e3c7e-bpchar-bpchar","purpose":"search","result_type":"bool","right_type":"bpchar","sort_family":"","sort_family_slug":"","strategy":"1"},{"description":"less than or equal","family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003c=~(bpchar,bpchar)","operator_slug":"op-7e3c3d7e-bpchar-bpchar","purpose":"search","result_type":"bool","right_type":"bpchar","sort_family":"","sort_family_slug":"","strategy":"2"},{"description":"equal","family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"=(bpchar,bpchar)","operator_slug":"op-3d-bpchar-bpchar","purpose":"search","result_type":"bool","right_type":"bpchar","sort_family":"","sort_family_slug":"","strategy":"3"},{"description":"greater than or equal","family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003e=~(bpchar,bpchar)","operator_slug":"op-7e3e3d7e-bpchar-bpchar","purpose":"search","result_type":"bool","right_type":"bpchar","sort_family":"","sort_family_slug":"","strategy":"4"},{"description":"greater than","family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","left_type":"bpchar","method":"btree","operator":"~\u003e~(bpchar,bpchar)","operator_slug":"op-7e3e7e-bpchar-bpchar","purpose":"search","result_type":"bool","right_type":"bpchar","sort_family":"","sort_family_slug":"","strategy":"5"}],"related":[{"label":"B-tree Index AM","url":"/wiki/indexam/btree/?v=18"}],"release":{"catalog_fingerprint":"deec62e0f0c649d9d0d058ddd0b16bf41afffd569c3fd73949ff0971ce5cabd6","channel":"stable","label":"18.6","major":"18","manual_fingerprint":"fefce9e478eb2afe5e17e869492bbedc67dce23d317f0a5257240113d6496ebc","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[{"paragraphs":["An index definition can specify an operator class for each column of an index.","The operator class identifies the operators to be used by the index for that column. For example, a B-tree index on the type int4 would use the int4_ops class; this operator class includes comparison functions for values of type int4 . In practice the default operator class for the column's data type is usually sufficient. The main reason for having operator classes is that for some data types, there could be more than one meaningful index behavior. For example, we might want to sort a complex-number data type either by absolute value or by real part. We could do this by defining two operator classes for the data type and then selecting the proper class when making an index. The operator class determines the basic sort ordering (which can then be modified by adding sort options COLLATE , ASC / DESC and/or NULLS FIRST / NULLS LAST ).","There are also some built-in operator classes besides the default ones:"],"title":"Operator classes and families"},{"paragraphs":["The operator classes text_pattern_ops , varchar_pattern_ops , and bpchar_pattern_ops support B-tree indexes on the types text , varchar , and char respectively. The difference from the default operator classes is that the values are compared strictly character by character rather than according to the locale-specific collation rules. This makes these operator classes suitable for use by queries involving pattern matching expressions ( LIKE or POSIX regular expressions) when the database does not use the standard “ C ” locale. As an example, you might index a varchar column like this:"],"title":"Specific manual guidance"}],"signature":"btree/bpchar_pattern_ops","source_oid":"2097","sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual: indexes-opclass.html","path":"indexes-opclass.html","sha256":"07de06abf3a2aff2a891a2789def434d9b76705e54d45ca5338dc13451ae2962","url":"/docs/18/indexes-opclass.html"},{"label":"PostgreSQL 18 English manual: catalog-pg-opfamily.html","path":"catalog-pg-opfamily.html","sha256":"d4a2b7c2bcb5350b0c1f0111b61e4566f46fd97f48802d3ced2421a7aea60b80","url":"/docs/18/catalog-pg-opfamily.html"},{"label":"PostgreSQL 18 English manual: catalog-pg-amop.html","path":"catalog-pg-amop.html","sha256":"e65b90ee78eaf4b4da97ce5b08b972cee2e2660b882ec107be22eca47201f7d1","url":"/docs/18/catalog-pg-amop.html"},{"label":"PostgreSQL 18 English manual: catalog-pg-amproc.html","path":"catalog-pg-amproc.html","sha256":"0a09afbde0ba8da9899bf770b86d8301bee116057b16ebe7db0e4a7fca2e91c6","url":"/docs/18/catalog-pg-amproc.html"},{"label":"PostgreSQL 18 English manual: indexes-opclass.html","path":"indexes-opclass.html","sha256":"07de06abf3a2aff2a891a2789def434d9b76705e54d45ca5338dc13451ae2962","url":"/docs/18/indexes-opclass.html"}],"support_functions":[{"family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","function":"btbpchar_pattern_cmp(bpchar,bpchar)","left_type":"bpchar","method":"btree","number":"1","result_type":"int4","right_type":"bpchar"},{"family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","function":"btbpchar_pattern_sortsupport(internal)","left_type":"bpchar","method":"btree","number":"2","result_type":"void","right_type":"bpchar"},{"family":"bpchar_pattern_ops","family_slug":"family-btree-bpchar_pattern_ops","function":"btequalimage(oid)","left_type":"bpchar","method":"btree","number":"4","result_type":"bool","right_type":"bpchar"}],"tables":[{"columns":[{"key":"operator","label":"Operator overload"},{"key":"strategy","label":"Strategy"},{"key":"purpose","label":"Purpose"},{"key":"sort_family","label":"Ordering family"},{"key":"scope","label":"Membership scope"},{"key":"description","label":"Source description"}],"key":"operators","rows":[{"description":"less than","operator":{"text":"~\u003c~(bpchar,bpchar)","url":"/wiki/operator/op-7e3c7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"1"},{"description":"less than or equal","operator":{"text":"~\u003c=~(bpchar,bpchar)","url":"/wiki/operator/op-7e3c3d7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"2"},{"description":"equal","operator":{"text":"=(bpchar,bpchar)","url":"/wiki/operator/op-3d-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"3"},{"description":"greater than or equal","operator":{"text":"~\u003e=~(bpchar,bpchar)","url":"/wiki/operator/op-7e3e3d7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"4"},{"description":"greater than","operator":{"text":"~\u003e~(bpchar,bpchar)","url":"/wiki/operator/op-7e3e7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"5"}],"title":"Family operator strategies"},{"columns":[{"key":"number","label":"Support number"},{"key":"left_type","label":"Left type"},{"key":"right_type","label":"Right type"},{"key":"function","label":"Function signature"},{"key":"result_type","label":"Result type"}],"key":"support-functions","rows":[{"function":"btbpchar_pattern_cmp(bpchar,bpchar)","left_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"number":"1","result_type":"int4","right_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"}},{"function":"btbpchar_pattern_sortsupport(internal)","left_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"number":"2","result_type":"void","right_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"}},{"function":"btequalimage(oid)","left_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"number":"4","result_type":"bool","right_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"}}],"title":"Family support functions"},{"columns":[{"key":"class","label":"Class"},{"key":"input_type","label":"Input type"},{"key":"key_type","label":"Key type"},{"key":"default","label":"Default"}],"key":"classes","rows":[{"class":{"text":"bpchar_pattern_ops","url":"/wiki/opclass/class-btree-bpchar_pattern_ops/?v=18"},"default":"no","input_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"key_type":"Same as input type"}],"title":"Classes in this family"}]},"ManualEvidence":{"release":{"catalog_fingerprint":"deec62e0f0c649d9d0d058ddd0b16bf41afffd569c3fd73949ff0971ce5cabd6","channel":"stable","label":"18.6","major":"18","manual_fingerprint":"fefce9e478eb2afe5e17e869492bbedc67dce23d317f0a5257240113d6496ebc","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual: indexes-opclass.html","path":"indexes-opclass.html","sha256":"07de06abf3a2aff2a891a2789def434d9b76705e54d45ca5338dc13451ae2962","url":"/docs/18/indexes-opclass.html"},{"label":"PostgreSQL 18 English manual: catalog-pg-opfamily.html","path":"catalog-pg-opfamily.html","sha256":"d4a2b7c2bcb5350b0c1f0111b61e4566f46fd97f48802d3ced2421a7aea60b80","url":"/docs/18/catalog-pg-opfamily.html"},{"label":"PostgreSQL 18 English manual: catalog-pg-amop.html","path":"catalog-pg-amop.html","sha256":"e65b90ee78eaf4b4da97ce5b08b972cee2e2660b882ec107be22eca47201f7d1","url":"/docs/18/catalog-pg-amop.html"},{"label":"PostgreSQL 18 English manual: catalog-pg-amproc.html","path":"catalog-pg-amproc.html","sha256":"0a09afbde0ba8da9899bf770b86d8301bee116057b16ebe7db0e4a7fca2e91c6","url":"/docs/18/catalog-pg-amproc.html"},{"label":"PostgreSQL 18 English manual: indexes-opclass.html","path":"indexes-opclass.html","sha256":"07de06abf3a2aff2a891a2789def434d9b76705e54d45ca5338dc13451ae2962","url":"/docs/18/indexes-opclass.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"opclass","Key":"family-btree-bpchar_pattern_ops","SourceDatabase":"center","Version":"18","Locale":"en","Title":"btree/bpchar_pattern_ops (family)","Summary":"B-tree operator family containing 1 classes, 5 operator strategies and 3 support functions in this source build.","BodyHTML":"\u003cp\u003eB-tree operator family containing 1 classes, 5 operator strategies and 3 support functions in this source build.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"b35b0ab9d68550bfdc806b4ee2b78d00f1e926bd2b038b282840001270eda274","Payload":{"description":["B-tree operator family containing 1 classes, 5 operator strategies and 3 support functions in this source build."],"related":[{"label":"B-tree Index AM","url":"/wiki/indexam/btree/?v=18"}],"sections":[{"paragraphs":["An index definition can specify an operator class for each column of an index.","The operator class identifies the operators to be used by the index for that column. For example, a B-tree index on the type int4 would use the int4_ops class; this operator class includes comparison functions for values of type int4 . In practice the default operator class for the column's data type is usually sufficient. The main reason for having operator classes is that for some data types, there could be more than one meaningful index behavior. For example, we might want to sort a complex-number data type either by absolute value or by real part. We could do this by defining two operator classes for the data type and then selecting the proper class when making an index. The operator class determines the basic sort ordering (which can then be modified by adding sort options COLLATE , ASC / DESC and/or NULLS FIRST / NULLS LAST ).","There are also some built-in operator classes besides the default ones:"],"title":"Operator classes and families"},{"paragraphs":["The operator classes text_pattern_ops , varchar_pattern_ops , and bpchar_pattern_ops support B-tree indexes on the types text , varchar , and char respectively. The difference from the default operator classes is that the values are compared strictly character by character rather than according to the locale-specific collation rules. This makes these operator classes suitable for use by queries involving pattern matching expressions ( LIKE or POSIX regular expressions) when the database does not use the standard “ C ” locale. As an example, you might index a varchar column like this:"],"title":"Specific manual guidance"}],"tables":[{"columns":[{"key":"operator","label":"Operator overload"},{"key":"strategy","label":"Strategy"},{"key":"purpose","label":"Purpose"},{"key":"sort_family","label":"Ordering family"},{"key":"scope","label":"Membership scope"},{"key":"description","label":"Source description"}],"key":"operators","rows":[{"description":"less than","operator":{"text":"~\u003c~(bpchar,bpchar)","url":"/wiki/operator/op-7e3c7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"1"},{"description":"less than or equal","operator":{"text":"~\u003c=~(bpchar,bpchar)","url":"/wiki/operator/op-7e3c3d7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"2"},{"description":"equal","operator":{"text":"=(bpchar,bpchar)","url":"/wiki/operator/op-3d-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"3"},{"description":"greater than or equal","operator":{"text":"~\u003e=~(bpchar,bpchar)","url":"/wiki/operator/op-7e3e3d7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"4"},{"description":"greater than","operator":{"text":"~\u003e~(bpchar,bpchar)","url":"/wiki/operator/op-7e3e7e-bpchar-bpchar/?v=18"},"purpose":"search","scope":"Family member","sort_family":"","strategy":"5"}],"title":"Family operator strategies"},{"columns":[{"key":"number","label":"Support number"},{"key":"left_type","label":"Left type"},{"key":"right_type","label":"Right type"},{"key":"function","label":"Function signature"},{"key":"result_type","label":"Result type"}],"key":"support-functions","rows":[{"function":"btbpchar_pattern_cmp(bpchar,bpchar)","left_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"number":"1","result_type":"int4","right_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"}},{"function":"btbpchar_pattern_sortsupport(internal)","left_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"number":"2","result_type":"void","right_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"}},{"function":"btequalimage(oid)","left_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"number":"4","result_type":"bool","right_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"}}],"title":"Family support functions"},{"columns":[{"key":"class","label":"Class"},{"key":"input_type","label":"Input type"},{"key":"key_type","label":"Key type"},{"key":"default","label":"Default"}],"key":"classes","rows":[{"class":{"text":"bpchar_pattern_ops","url":"/wiki/opclass/class-btree-bpchar_pattern_ops/?v=18"},"default":"no","input_type":{"text":"bpchar","url":"/wiki/type/bpchar/?v=18"},"key_type":"Same as input type"}],"title":"Classes in this family"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
