Excel export to PostgreSQL with Primary key

You can try to use the “Advanced mode” of the “Create table” command and specify PRIMARY KEY constraint for your primary key column with the “Custom definition” option: