Help for this page

Select Code to Download


  1. or download this
    # bash 
    
    ...
    server fs options(delimiter'$sep',format'csv',header'TRUE',filename'$f
    +ile');
    SQL_PERL
    
  2. or download this
    create server if not exists fs foreign data wrapper file_fdw;
    
    ...
     , head3 text
    )
    server fs options(delimiter'|',format'csv',header'TRUE',filename'/tmp/
    +flatfile.dat');
    
  3. or download this
    
    (select 'head1' "heads", array_agg(distinct head1 order by head1) "val
    +ues" from flattable) union all 
    ...
    --  head3 | {val3,val5}
    -- (3 rows)