Example 6—Multiple files in CSV format with header rows

Creates a readable external table, ext_expenses, using the file protocol. The files are CSV format and have a header row.

  1. =# CREATE EXTERNAL TABLE ext_expenses ( name text,
  2. date date, amount float4, category text, desc1 text )
  3. LOCATION ('file://filehost/data/international/*',
  4. 'file://filehost/data/regional/*',
  5. 'file://filehost/data/supplement/*.csv')
  6. FORMAT 'CSV' (HEADER);

Parent topic: Examples for Creating External Tables