Re: How are pg_operator and pg_type related with each other?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Felix(dot)徐 <ygnhzeus(at)gmail(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How are pg_operator and pg_type related with each other?
Date: 2014-01-15 17:47:22
Message-ID: 28576.1389808042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?GB2312?B?RmVsaXgu0Ow=?= <ygnhzeus(at)gmail(dot)com> writes:
> I'm wondering where I can find the corresponding operatorID of eq/lt for a
> specific data type.

The ones ANALYZE uses are the members of the default btree opclass for
the datatype. If there isn't one, it doesn't build a histogram.

> And another question is that how to update or insert a column with type of
> "anyarray", since I want to mock the statistic data of tables, the type of
> stavalues in pg_statistic is anyarray, is there any way to manually modify
> that column, by some kind of function or hook?

I don't believe that's possible from SQL; as you found out, the type
system won't allow it, and it'd be a security hole if it did (since
there wouldn't be any check that the data you store actually matches
the type of the column the pg_statistic row claims to be about).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2014-01-15 17:58:22 Re: Need Help to implement Proximity search feature
Previous Message Ming Li 2014-01-15 17:45:32 Re: non-zero xmax yet visible