Alter composite type that used in column as array of composite type

121 Views Asked by At

I have composite type in postgres

composite_type(numeric(10, 2), numeric(10, 3))

Table example

id(serial) comp(composite_type[])
... ...

I need to alter first attribute to numeric(12, 2). If I try to alter type manually, i have error:

Type can't be alter because it used in column

How I can alter this type without data loss?

P.S. I use doctrine and symfony

  1. I try to alter type as in documentation
  2. May be I need to create new type, then cast my column to it and then delete old type and rename new, but I don't know how to cast array of composite type.
0

There are 0 best solutions below