Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
63337: sql: serialize user defined type annotation of arrays r=ajwerner a=the-ericwang35 Previously, user defined type annotations for arrays were not serialized. For example, `ARRAY['a'::typ]` would get serialized into `ARRAY[b'\x80':::@100059]:::public.typ[]`. As a result, when we renamed the type, the expression using the array would become corrupted. Ex. ``` CREATE TYPE typ AS ENUM('a'); CREATE TABLE t (i typ[] DEFAULT ARRAY['a'::typ]); ALTER TYPE typ RENAME TO new_typ; INSERT INTO t VALUES (default); # ERROR: type "public.typ" does not exist ``` This patch addresses this by serializing the type annotation using its OID. Now, the internal representation looks like `ARRAY[b'\x80':::@100059]:::@100060` and renames work fine. Release note: None Co-authored-by: Eric Wang <[email protected]>
- Loading branch information