Fixed a bug reading empty strings from Postgres databases.
[pspp-builds.git] / src / data / psql-reader.c
index 72e14be4fce9542eb8f7c92b6a21563fc2842f0c..9df82b558c69252930fdf932e0ed5575edd3cfa8 100644 (file)
@@ -442,6 +442,10 @@ psql_open_reader (struct psql_read_info *info, struct dictionary **dict)
          break;
        }
 
+      if ( width == 0 && fmt_is_string (fmt.type))
+       fmt.w = width = MAX_SHORT_STRING;
+
+
       var = create_var (r, &fmt, width, PQfname (qres, i), i);
       if ( type == NUMERICOID && n_tuples > 0)
        {