file-fdw and force_null

From: Boshomi Phenix <boshomi(at)gmail(dot)com>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: file-fdw and force_null
Date: 2023-09-11 14:28:50
Message-ID: CAJVkCUparn4_Oarernm=U6LWVsTkecKcALHtwGr5M3qJRj_czw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hello Friends

I tried to create a file-fdw foreign table with force_null for some columns.
FORCE_NULL syntax differs from COPY. For me it was not clear that the
"OPTIONS" keyword by the column was necessary, so it would be nice to add
this to the example.

DROP FOREIGN TABLE IF EXISTS testforcenull;
CREATE FOREIGN TABLE testforcenull
( cola text NOT NULL,
colb text,
colc text OPTIONS(FORCE_NULL 'true')
) SERVER bevcsv
OPTIONS (filename '~/testforcenull.csv',
FORMAT 'csv',
HEADER 'true',
DELIMITER ';',
QUOTE '"'
);

best regards

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Daniel Gustafsson 2023-09-12 10:25:26 Re: file-fdw and force_null
Previous Message Laurenz Albe 2023-09-09 02:56:36 Re: Remove obsolete mention of backslashes as escapes