Why are there too many to fix with ALTER?
>
I mean that there are too many to fix with manually typed ALTER statements,
pure laziness, so I am looking at an automated method.
> Use SQL and the data dictionary to generate the DDL and pipe it into psql
> (or spool it to disk and use that file as a
Tony Cade skrev:
> select relfilenode from pg_class where relname='rates'
>
> update pg_attribute set attname=lower(attname) where attnum >0 and
> attrelid= ( from above query)
Instead of the second one, do
SELECT
'ALTER TABLE rates RENAME COLUMN ' || attname || ' TO ' ||
lower(attname
Why are there too many to fix with ALTER?
Use SQL and the data dictionary to generate the DDL and pipe it into
psql (or spool it to disk and use that file as a sql script):
psql your_db_name -t -c "select 'alter table '||t.tablename||' rename
\"'||c.column_name||'\" to '||lower(c.column_name)||
Hello Tony,
Perhaps this will help maybe not. Since the original data import
used quotes for the fields then any case was maintained in the
creation of the new table(s) & fields(s). Just take your original
import file and remove all the quotes, ",. Re-import and and
PostgreSQL will use all lowerca
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=