Search Postgresql Archives

Re: alter multiple tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
To: "Kodok Marton" <marton@xxxxxxxxxxxxxxxxxxxxxx>
Cc: <pgsql-general@xxxxxxxxxxxxxx>
Sent: Monday, March 16, 2009 6:08 PM
Subject: Re:  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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux