From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id A9D12235B0 for ; Mon, 11 Mar 2019 04:05:01 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JgOgVLltkmVL for ; Mon, 11 Mar 2019 04:05:01 -0400 (EDT) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 3E6F3223A6 for ; Mon, 11 Mar 2019 04:05:01 -0400 (EDT) Received: by mail-lj1-f194.google.com with SMTP id z20so3134879ljj.10 for ; Mon, 11 Mar 2019 01:05:01 -0700 (PDT) Date: Mon, 11 Mar 2019 11:04:58 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 1/2] sql: derive collation for built-in functions Message-ID: <20190311080458.GE3101@chai> References: <92715853-76c0-36ca-1bae-84a8a8939f7e@tarantool.org> <7CC1E113-479D-46FC-9A6F-6BE73E918FE7@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: "n.pettik" * Vladislav Shpilevoy [19/03/07 17:44]: > It contradicts with your way of collation return. If PSQL states > that collation is a part of string-like type, then it is > possible to implement a function doing something like this: > > function my_func() > if (rand() % 2 == 0) then > return 'abc' collate 'unicode_ci'; > return 'abc' collate 'unicode'; > end; > > (I do not know PSQL syntax - the code above is pseudo- ). It would be impossible in SQL/PSM, since a function return value is strictly typed, so there would be a type error or automatic coercion to return type collation. > As I see, now we have no runtime defined collations at all - > all of them are known during compilation. Struct Mem, storing > function return value, even has no collation member. I guess, > we can not implement runtime collations now. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov