Re: alter multiple tables

From: "Kodok Marton" <marton(at)mybusinessanywhere(dot)com>
To: "Tino Wildenhain" <tino(at)wildenhain(dot)de>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: alter multiple tables
Date: 2009-03-16 16:14:42
Message-ID: E335D0EC06CE459994B5DAE229D41A71@martondesktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

doing via shell is one way (long way if you use Windows),
is it possible by updateding postgresql master tables?

----- Original Message -----
From: "Tino Wildenhain" <tino(at)wildenhain(dot)de>
To: "Kodok Marton" <marton(at)mybusinessanywhere(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Monday, March 16, 2009 6:08 PM
Subject: Re: [GENERAL] alter multiple tables

> Hi,
>
> Kodok Marton wrote:
>> Hello,
>>
>> I have in every table columns like:
>> username character varying(20) NOT NULL
>>
>> I want to extend the length of varchar in all tables.
>
> next time you should probably consider using a domain type
> (or stick to text)
>
>> Since I have a lot of tables and mirrored backups, I am wondering if
>> there is a way to alter automatically all tables where colname matches
>> 'username'
>>
>> Is there a way to do this?
>
> It should be possible to generate a list of tables either via
> query or using pg_dump -L with grep and create SQL based on this
> (with a script, unix shell) and execute it against the database.
>
> (Test this of course)
>
> HTH
> Tino
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-03-16 17:38:05 Re: deployment query
Previous Message Tino Wildenhain 2009-03-16 16:08:09 Re: alter multiple tables