Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKMSs-0003jY-A6 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jul 2016 09:16:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bKMSr-0001Pl-Ou for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jul 2016 09:16:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bKMSq-0001O9-1c for pgsql-hackers@postgresql.org; Tue, 05 Jul 2016 09:16:20 +0000 Received: from palladium.wars-nicht.de ([89.238.64.91] helo=polonium.wars-nicht.de) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bKMSn-0004Y2-3D for pgsql-hackers@postgresql.org; Tue, 05 Jul 2016 09:16:19 +0000 Received: from localhost (localhost [127.0.0.1]) by polonium.wars-nicht.de (Postfix) with ESMTP id C500D114039; Tue, 5 Jul 2016 11:16:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at polonium X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from polonium.wars-nicht.de ([127.0.0.1]) by localhost (polonium.wars-nicht.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pPSNbn62v2BH; Tue, 5 Jul 2016 11:16:14 +0200 (CEST) Received: from diamond.wars-nicht.de (unknown [212.86.58.192]) by polonium.wars-nicht.de (Postfix) with ESMTPSA id CE0F7114037; Tue, 5 Jul 2016 11:16:14 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by diamond.wars-nicht.de (Postfix) with ESMTP id 418A81BE295A; Tue, 5 Jul 2016 11:16:14 +0200 (CEST) Subject: Re: to_date_valid() To: Pavel Stehule References: <57786490.9010201@wars-nicht.de> <577A8DC8.2040505@wars-nicht.de> <577B01A9.8080102@wars-nicht.de> Cc: Craig Ringer , Euler Taveira , PostgreSQL mailing lists From: Andreas 'ads' Scherbaum Message-ID: <577B7ADE.5070504@wars-nicht.de> Date: Tue, 5 Jul 2016 11:16:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 05.07.2016 06:05, Pavel Stehule wrote: > > > 2016-07-05 2:39 GMT+02:00 Andreas 'ads' Scherbaum >: > > On 04.07.2016 18:37, Pavel Stehule wrote: > > > I don't know if the name "strict" is best, but the name > "validate" is > not good too. Current to_date does some validations too. > > > Obviously not enough, because it allows invalid dates. I'd say that > the current to_date() merely validates the input format for string > parsing, and that the date is in range. But there is not much > validation on the date itself. > > So the name can't be "strict" because of the conflict with "NULL" > handling, and you don't like "valid" - what other options do you offer? > > > I have not - so third option looks best for me - it can be long name > "only_correct_date", "only_valid_date", "only_valid_date_on_input" ... Then you don't have "to_date" in the function name, but still use "valid" in the name. How is that useful to remember the function? Where "to_date_valid" already gives you the idea that it is "to_date" with an additional "valid"ator. Don't make it overly complicated. -- Andreas 'ads' Scherbaum German PostgreSQL User Group European PostgreSQL User Group - Board of Directors Volunteer Regional Contact, Germany - PostgreSQL Project -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers