0

I have a CSV file that contains a number of columns with t / f values. I'm trying to write this data to Postgres using pgadmin.

The columns in the target table in postgres are set to type boolean which only accepts 'TRUE' 'FALSE'.

How might I convert these t / f values to TRUE/FALSE in order that my table import doesn't fail. Any hints or other approaches to this problem would be appreciated.

  • 2
    `t` and `f` [are acceptable strings](https://www.postgresql.org/docs/9.1/static/datatype-boolean.html) for a boolean column, so your data should import fine. If it's not, please show a sample of your data, the table schema, and the import error. – cdhowie Jun 06 '18 at 14:34
  • what cdhowie said plus: show us the command you use to import the file. –  Jun 06 '18 at 14:35
  • 1
    Are you **really** still using Postgres 9.1? If yes, you should plan the upgrade to a supported and maintained version now. –  Jun 06 '18 at 14:36
  • Problem solved. Forgot to add header when importing Many thanks for your assistance. – Keith C. Jun 06 '18 at 16:50

0 Answers0