Tony Cade wrote:

> There are too many fields to issue alter table commands to rename in SQL so
> my question is , is it safe to use a query such as
> 
>     select relfilenode from pg_class where relname='rates'

> update  pg_attribute set attname=lower(attname) where attnum >0 and
> attrelid=nnnn ( from above query)

Don't do that.  It's far better to create a shell script, or PL/pgSQL
function, whatever suits you, to get the table/column names from the
catalog and then produce the ALTER TABLE commands you need.

Playing directly with the catalogs is *never* supposed.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to