When I insert data in PostgreSQL, it is auto inserting many spaces after the value of the field.
I tired to fix it, but I can't find anything
For example: I want to insert value 'John' in column 'Name'. It inserts spaces after John.
character is an awful data type that should not be used. This is just one of the reasons. See character types - postgresql manual.
Change those fields to
text or to
text with a
check constraint on length where one is required is usually the best option.
ALTER TABLE thetable ALTER COLUMN colname TYPE text;
BTW, it's easier to answer your questions if you post the SQL and - preferably - the output of running that SQL in
psql, which produces copy-and-pasteable plain text output.