Giter VIP home page Giter VIP logo

file_text_array_fdw's Introduction

File Text Array Foreign Data Wrapper for PostgreSQL

This FDW is similar to the provided file_fdw, except that instead of the foreign table having named fields to match the fields in the data file, it should have a single field of type text[]. The parsed fields will be stashed in the array. This is useful if you don't know how many fields are in the file, or if the number can vary from line to line. Unlike standard COPY files and the file_fdw module, this module doesn't care how many fields there are - however many it finds on each line will be put into the array.

Example of use:

-- only needs to be done once
CREATE EXTENSION file_textarray_fdw;

-- usually only needs to be done once
CREATE SERVER file_server FOREIGN DATA WRAPPER file_textarray_fdw;

CREATE FOREIGN TABLE agg_csv_array (
	   t text[]
) 
  SERVER file_server
  OPTIONS (format 'csv', 
           filename '/path/to/agg.csv', 
           header 'true', 
           delimiter ';', 
           quote '@', 
           escape '"', 
           null '');

SELECT t[1]::int2 AS a, 
       t[2]::float4 AS b
FROM agg_csv_array;

file_text_array_fdw's People

Contributors

adunstan avatar hlinnaka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.