Alter Columns with Triggers
От | Adrian Parker |
---|---|
Тема | Alter Columns with Triggers |
Дата | |
Msg-id | CAFTut86VctEKEy7uEopQ91gOthhi=tLqDRoniVUBCE6De9KJGQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Alter Columns with Triggers
Re: Alter Columns with Triggers |
Список | pgsql-general |
Hello. I'm quite new to Postgres. I've just been assigned the task of changing 300+ Double Precision columns, spread out over 30+ tables, to be of type Numeric(100, 3). Many of the columns have one or more triggers/functions on them. The alterations will run from a python program acting as a database migrator, and access to the database will be disabled while the migrator runs. I can progmatically query for all columns of type double precision, and run Alter statements against them, but how do I deal with Triggers/Functions? It seems I need to remove both the trigger and function, and re-add them after the table is altered. Some functions refer to others though. None of the columns to be changed are primary or foreign keys. Ideally I'd like a query that allows me to alter all the column types which I need to alter despite the triggers/functions in place, but I suppose this is not possible. Is there a quick and easy fix? Currently I'm copying/pasting the drop/create statements from pgadmin (its very slow and error prone) and putting them in my python source. Adrian
В списке pgsql-general по дате отправления: