Example 6—Multiple files in CSV format with header rows

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.

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