How do I import the _id index from a MongoDB collection as a hash index for a PostgreSQL table (from a CSV export from MongoDB)?
MongoDB uses a BSON object 24 character hash for its index (_id)

Values are stored in columns in a relational database, not &quot;in an index&quot;. To store such a character (aka &quot;string&quot;) value, create a column of type varchar(24) to hold the _id value from MongoDB.
If you want to ensure uniqueness, then create a unique B-Tree index on the column or defined it as the primary key.
Something along the lines:
create table mongo_data
(
  id varchar(24) primary key, 
  ... other columns ...
);

The fact that the value is computed by a &quot;hash algorithm&quot; in MongoDB has nothing to do with a &quot;hash index&quot; in Postgres.