Search Postgresql Archives

Re: Difference between text_pattern_ops and varchar_pattern_ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Morgenstern <d.morgenstern@xxxxxxxxxxx> writes:
> Can somebody explain why text_pattern_ops can be used on varchar
> columns, considering it can’t be used for bpchar columns?

The underlying rule there is that an opclass can be applied to an index
column if the column's actual type is binary-coercible to what the opclass
expects.  varchar is binary-coercible to text, since they're basically the
same type.  bpchar is not, because we must insert a coercion function that
strips any trailing blanks.  (Essentially, the restriction exists because
the index machinery won't cope with such intermediate functions.)

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux