Query for get column number in PostgreSQL
select      ordinal_position

from        information_schema.columns

where       table_catalog = 'my_table_catalog'
        and table_schema  = 'my_table_schema'
        and table_name    = 'my_table_name'
        and column_name   = 'my_column_name'