Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There could be a few possible reasons for all columns in the CSV file to be converted to character varying in PostgreSQL after importing and converting with QGIS's DB Manager:

  1. QGIS's DB Manager may have applied the default data type of "character varying" to all columns in the table during the import process.

  2. The CSV file may have contained mixed data types in the columns, and QGIS's DB Manager may have automatically converted all columns to text fields (character varying) to avoid errors.

  3. The PostgreSQL database may have been set to use "character varying" as the default data type for all columns during the creation of the database or the table.

To avoid this issue, it's important to check the data types of the source CSV file and ensure they match the desired data types in the target PostgreSQL database before importing and converting the file. You may also need to adjust the data type settings in QGIS's DB Manager or PostgreSQL to ensure data integrity and avoid unexpected conversions.