How do I create a view with new snake_case columns (replacing camelCase) and remaining original columns? (using the output of `FORMAT`) Unfortunately I am in a position where I have to use camelCase column names for my database, as the source data dictates so.

However, I am using an application where I can only query for snake_case columns (as discussed here).

I want to create a view table that has all the same columns, except those with camelCase names replaced with a snake_case name, so this query

SELECT * FROM view_name;


will return 

| id  | name | column_one |...|
|-----|------|------------|---|
| ... | ...  | ...        |   |


I can do this manually like this:

CREATE VIEW view_name AS SELECT id, name, schema.table."columnOne" AS column_one FROM schema.table


but I have too many columns, is there a way to do this automatically for all columns?

UPDATE 1:
Made progress on this, I am able to get the string of all the columns I need from one table like this, but I still don't know how to use it with CREATE VIEW:

(SELECT FORMAT(
  '%I.%I.%I."%I",',
  table_catalog,
  table_schema,
  table_name,
  column_name
)
FROM information_schema.columns
WHERE column_name !~ ' |[[:lower:]][[:upper:]]'
AND table_name = 'example_table_name')
UNION
(SELECT FORMAT(
  '%I.%I.%I.%I AS %I,',
  table_catalog,
  table_schema,
  table_name,
  column_name,
  lower(
    -- replace all spaces with _, xX and Xx becomes x_x
    regexp_replace(
      -- First, replace spaces with an _
      replace(column_name, ' ', '_'),
      '([[:lower:]])([[:upper:]])',
      '\1_\2',
      'g'
    )
  )
)
FROM information_schema.columns
WHERE column_name ~ ' |[[:lower:]][[:upper:]]'
AND table_name = 'example_table_name')


which results in 

                                    format
------------------------------------------------------------------------
 db.schema.table."id",
 db.schema.table."name",
 db.schema.table."columnOne" AS column_one,
 db.schema.table."columnTwo" AS column_two


I want to CREATE VIEW from the output of format, how can I do this?
If you're the TL:DR; type, please find the solution here

with snakes as (
    select 
        ordinal_position,
        table_catalog,
        table_schema,
        table_name,
        format('%I.%I.%I',table_schema,table_name,column_name) as full_name,
        lower(
            -- replace all spaces with _, xX and Xx becomes x_x
            regexp_replace(
                -- First, replace spaces with an _
                replace(table_name, ' ', '_'),
                '([[:lower:]])([[:upper:]])',
                '\1_\2',
                'g'
            )
        ) as snake_case_table,
        lower(
            -- replace all spaces with _, xX and Xx becomes x_x
            regexp_replace(
                -- First, replace spaces with an _
                replace(column_name, ' ', '_'),
                '([[:lower:]])([[:upper:]])',
                '\1_\2',
                'g'
            )
        ) as snake_case_column
    from information_schema.columns
    where table_catalog =  current_database()
      and table_schema in ('public')
), tables as (
    select 
        format('%I.%I',table_schema,'vw_'||snake_case_table) as view_name,
        string_agg(
                full_name||' as '||snake_case_column, 
                ','||chr(10)||'        ' order by s.ordinal_position

        ) as column_list,
        format('%I.%I',table_schema,table_name) as base_table
    from snakes s
    group by
        s.table_catalog,
        s.table_schema,
        s.table_name,
        s.snake_case_table
)
select 
    'create or replace view '||view_name||' '||chr(10)||
    'as '||chr(10)||
    '    select '||chr(10)||
    '        '||column_list||chr(10)||
    '    from '||base_table||';'||chr(10)||chr(10)
    as create_view_command
from tables;


As you can see on the fiddle, the output of this should be one create view command for every table in the current database. Please note I haven't worked with postgres foreign data wrappers, so I've removed the cross-database references (but they should be rather trivial to add back in).

The only material additions I've made to your code are the use of string_agg() and group by. However, re: format('%I."%I"',...), you can lose the double quotes here. As per the docs


  I treats the argument value as an SQL identifier, double-quoting it if necessary. ...