Forum OpenACS Q&A: How to change the field length of product name in ec_products.

I have been searching for hours now on the web to find an example of the ALTER TABLE syntax required to increase the size of the product_name field in ec_products from 200 to 400 but cannot find any guidance.


Whilst I see I could maybe rename the field and add a new one with the name product_name, this seems a bit messy and I worry that it may screw up the indices and triggers.


Can anyone help me with this?


My best effort so far is:

ALTER TABLE table ALTER COLUMN product_name CHARACTER VARYING(400);

Have also tried:
ALTER TABLE table ALTER COLUMN product_name VARCHAR(400);

To no avail.
Regards
Richard
Richard,

PG doesn't support changing the size of columns (yet). However, you can safely change the size through the PG system tables. However, you could screwup the whole database if something goes wrong.

You'll find instructions at: http://fts.postgresql.org/db/mw/msg.html?mid=1071582

/Bart

Thanks Bart,
I suspected that the obvious answer would be far too simple!
I think I will work around this problem a different way for now and play with the system tables at my leisure on a test system.
Many thanks for the help.
R.