Re: Create a Foreign Table for PostgreSQL CSV Logs - Mailing list pgsql-docs

From David G. Johnston
Subject Re: Create a Foreign Table for PostgreSQL CSV Logs
Date
Msg-id CAKFQuwY=pgJLDfcmy6T0_mjL0RGcZQFFALKM=_q9YkfAhmiVcA@mail.gmail.com
Whole thread Raw
In response to Re: Create a Foreign Table for PostgreSQL CSV Logs  (Олег Самойлов <splarv@ya.ru>)
Responses Re: Create a Foreign Table for PostgreSQL CSV Logs  (Bruce Momjian <bruce@momjian.us>)
List pgsql-docs
On Mon, Aug 24, 2020 at 6:17 AM Олег Самойлов <splarv@ya.ru> wrote:
There must not be constraints at all. Constraints are needed to check incoming data to the table. But here table is read-only for database!

Please don't top-post.


So all your constraints is totally useless.
> > could become:
> >
> > connection_from text check(connection_from ~ '^[^:]+:[0-9]+$) -- the host and
> > port of the client, colon-separated

I'll agree that the benefit for adding the constraints to a foreign table are less than for a normal table but it is still not zero.  Constraints are also a form of documentation.  And also can be used (at least non-null ones) during optimization.

David J.

pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Document "59.2. Built-in Operator Classes" have a clerical error?
Next
From: Bruce Momjian
Date:
Subject: Re: Procedures