Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

README.dbf2pg

  • Bruce Momjian's avatar
    82bade79
    dbf2pg - Insert xBase-style .dbf-files into a PostgreSQL-table · 82bade79
    Bruce Momjian authored
      There is an option "-s oldname=newname", which changes the old field name of
      the dbf-file to the newname in PostgeSQL. If the length of the new name is 0,
      the field is skiped. If you want to skip the first field of the dbf-file,
      you get the wildest error-messages from the backend.
      dbf2pg load the dbf-file via "COPY tablename FROM STDIN". If you skip the
      first field, it is an \t to much in STDIN.
    
    A fix could be an counter j=0, which increments only, if a field is imported
    (IF (strlen(fields[h].db_name)> 0) j++. And only if j > 1 (if an other field is
    imported) the \t is printed.
    
    An other small bug in the README:
    -s start
                  Specify  the  first record-number in the xBase-file
                  we will insert.
    should be
    -e start
                  Specify  the  first record-number in the xBase-file
                  we will insert.
    
    Thomas Behr
    82bade79
    History
    dbf2pg - Insert xBase-style .dbf-files into a PostgreSQL-table
    Bruce Momjian authored
      There is an option "-s oldname=newname", which changes the old field name of
      the dbf-file to the newname in PostgeSQL. If the length of the new name is 0,
      the field is skiped. If you want to skip the first field of the dbf-file,
      you get the wildest error-messages from the backend.
      dbf2pg load the dbf-file via "COPY tablename FROM STDIN". If you skip the
      first field, it is an \t to much in STDIN.
    
    A fix could be an counter j=0, which increments only, if a field is imported
    (IF (strlen(fields[h].db_name)> 0) j++. And only if j > 1 (if an other field is
    imported) the \t is printed.
    
    An other small bug in the README:
    -s start
                  Specify  the  first record-number in the xBase-file
                  we will insert.
    should be
    -e start
                  Specify  the  first record-number in the xBase-file
                  we will insert.
    
    Thomas Behr