Hot answers tagged

1

The basic misunderstanding is that you assume variable substitution for an SQL utility command like ALTER TABLE, which is not implemented. Equally not possible to pass values for utility commands to EXECUTE with the USING clause in plpgsql. Detailed explanation for both in this related answer on SO: Error when setting n_distinct using a plpgsql variable ...


1

There are some. The most reliable I've seen so far (at least when the development process is also have to be considered) is having diffs. Basically, all DB objects (tables, types, functions, etc.) are defined one by one in files, which are then under version control. When you want to change something, you write a diff (ALTER TABLE, for example) and change ...



Only top voted, non community-wiki answers of a minimum length are eligible