I am new to PostgreSQL and was wondering if there is a table which matches Oracle's user\_cons\_columns table which provides a column position column similar to ***user\_cons\_columns.position***. Essentially, I am trying to convert the following oracle code to PostgreSQL. It attains the PK columns in order of PK definition: 

Oracle Code (Original):
=======================

```
select a.table_name tab_name,
       a.colum_name col_name, 
       a.position   col_order
from user_cons_columns a, 
     user_constraints b
where a.table_name = b.table_name
and   a.constraint_name = b.constraint_name
and   b.constraint_type = 'P'
and   a.table_name = 'some_table_name';

```

PostgreSQL Code (Oracle Equiv):
===============================

```
/* Below is my attempt at the PostgreSQL conversion */
select isc.table_name       tab_name,
       isc.column_name      col_name, 
       isc.ordinal_position col_order
from pg_attribute as pga
inner join pg_class as pgc on pga.attrelid = pgc.oid
inner join pg_namespace as pgn on pgn.oid  = pgc.relnamespace
inner join information_schema.columns as isc on isc.column_name = pga.attname
      and isc.table_name = pgc.relname 
where isc.table_name = 'sometablename';

```

In my PostgreSQL conversion attempt I am missing the relationship between the constraint and its position but use the column position. Which is not the same. Is there a way to do the former? Thanks in advance!