Hyperstage COPY FROM Syntax

In this section:

COPY FROM allows for very fast loading of file data in a single step. This is equivalent to LOAD DATA INFILE, for those familiar with MySQL. The COPY FROM syntax works in a manner similar to standard PostgreSQL (COPY FROM). However, there are differences in the options supported. The examples and table below outline these differences.


Top of page

x
Usage Examples
copy tab1 from '/tmp/data' with (format txt_variable, lines_terminated_by
e'\n', delimiter ';')
copy tab1 from '/tmp/data' with (format infobright)
copy tab1 from '/tmp/data' with (format ib_binary)
 
COPY table_name
    FROM { 'filename' | STDIN }
    [ [ WITH ] ( option [, ...] ) ]

where:

option

Can be one of the following:

  • format: {'txt_variable' | 'infobright' | 'ib_binary'}
  • fields-terminated-by
  • fields-enclosed-by
  • escaped-by
  • data-chartset 'encoding_name'
  • lines_terminated_by
  • reject-file-path
  • abort-on-count
  • abort-on-threshold
  • input type {'client' | 'server'}
  • timeout

PARAMETERS

PARAMETER

EQUIVALENT DLPPARAMETER NAME

AVAILABLE VALUES

DEFAULT VALUE WITH HYPERSTAGE

format

 

txt_variable

infobright

ib_binary

txt_variable

delimiter

fields-terminated-by

only a single one-byte character

\t

quote

fields-enclosed-by

only a single one-byte character

(empty)

escape

escaped-by

only a single one-byte character

(empty)

encoding

data-chartset

only supported encodings by Hyperstage

(database encoding) *4-byte UTF-8 characters (CHAR, VARCHAR types) are replaced with question marks (?)

lines_terminated_by

lines-terminated-by

 

(empty)

reject_file_path

reject-file-path

 

(not specified)

abort_on_count

abort-on-count

 

(disabled)

abort_on_threshold

abort-on-threshold

in range (0,1)

(disabled)

pipe_mode

input-type

client

server

(not used)

timeout

timeout

 

600s



x
Data Format (Mandatory)

You must set the data format parameter. Possible values are:


WebFOCUS