From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Mike Lissner <mlissner(at)michaeljaylissner(dot)com> |
Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: Does converting an indexed varchar to text rewrite its index? Docs say so, tests say no. |
Date: | 2020-01-23 22:01:15 |
Message-ID: | f3a6e34e-ebc6-e740-0f6f-f79d7a568f76@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 1/23/20 1:28 PM, Mike Lissner wrote:
> You wrote:
>
> > Well it did not rebuilt the index("t1_name_idx") you created on name.
>
> OK, so then the docs *are* wrong? They say that:
>
> > any indexes on the affected columns must still be rebuilt.
>
> But that doesn't happen? Sorry to be persistent. I'm just a bit confused
> here.
My guess is that it is because in Postgres varchar is just text with an
optional length restriction. I say optional because you can do:
CREATE TABLE t2 (id serial PRIMARY KEY, name varchar);
So as I understand it when you are go from varchar to text you are not
really changing type, just the type oid. I tried searching the source
for confirmation of this to no avail. A definitive answer is going to
need come from someone with more knowledge of the internals.
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-01-23 22:21:40 | Re: Does converting an indexed varchar to text rewrite its index? Docs say so, tests say no. |
Previous Message | Mike Lissner | 2020-01-23 21:28:56 | Re: Does converting an indexed varchar to text rewrite its index? Docs say so, tests say no. |