Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAE4K-0001pt-AB for pgsql-docs@arkaria.postgresql.org; Mon, 24 Aug 2020 15:07:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAE4I-0002S6-1k for pgsql-docs@arkaria.postgresql.org; Mon, 24 Aug 2020 15:07:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAE4H-0002Ry-Q3 for pgsql-docs@lists.postgresql.org; Mon, 24 Aug 2020 15:07:29 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAE4F-0001F4-5G for pgsql-docs@lists.postgresql.org; Mon, 24 Aug 2020 15:07:28 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kAE4D-00057m-J5; Mon, 24 Aug 2020 11:07:25 -0400 Date: Mon, 24 Aug 2020 11:07:25 -0400 From: Bruce Momjian To: "David G. Johnston" Cc: =?utf-8?B?0J7Qu9C10LMg0KHQsNC80L7QudC70L7Qsg==?= , Pg Docs Subject: Re: Create a Foreign Table for PostgreSQL CSV Logs Message-ID: <20200824150725.GJ26781@momjian.us> References: <159800192078.2886.10431506404995508950@wrigleys.postgresql.org> <20200821215807.GE13363@momjian.us> <20200822175156.GG26781@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Aug 24, 2020 at 07:40:49AM -0700, David G. Johnston wrote: > On Mon, Aug 24, 2020 at 6:17 AM Олег Самойлов 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. I feel constraints are going to lose focus of what we are trying to show. Do the constraints actually do anything on a foreign table? If not, we would have to mention that here too, which might be fine. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee