Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLoTJ-0005NF-8O for pgsql-general@arkaria.postgresql.org; Sat, 19 Oct 2019 13:08:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iLoTF-0008UM-Rs for pgsql-general@arkaria.postgresql.org; Sat, 19 Oct 2019 13:08:37 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLoTF-0008Sm-CR for pgsql-general@lists.postgresql.org; Sat, 19 Oct 2019 13:08:37 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLoTB-0004d6-3D for pgsql-general@postgresql.org; Sat, 19 Oct 2019 13:08:36 +0000 Received: by mail-wr1-x442.google.com with SMTP id z9so8974181wrl.11 for ; Sat, 19 Oct 2019 06:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=W68OfRTv73JRlDcWYQHYu7t+2CwRfnVvMEr34l6xSTo=; b=SIre34RxiwPrJelhKl+9gSC4/sP8MkPPmttc6gM1cqj/Dl6ZgoenXgHP/hyRQoE0DK pLdakRmRlr4JksvpzsKcOir/RYudHkSNFYdfkC0LM7zKxUspX3ubtXQQkaqwifZflkWT hJdV0vfGWe4FIhVbca3KJ20E82QXaCDGv42Fca7cJMSeCpdUwRKiFmb87tERWnJn3Um0 Bh2krgBdEXpiSBjIK+cZyE1N0l9Rez31wySDXxPdwdC91oFqRjpM3kMcQX8vGvlksOMA 420HCbOHGbACY66ZHsFj0m+0TCgF/JpH9qAmI9VoieiJkrnDMM60w+DfbsyazzYZtTmu 4k8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=W68OfRTv73JRlDcWYQHYu7t+2CwRfnVvMEr34l6xSTo=; b=RjCFuOvpg8Ixir74tObtjgvu6cIyFkRYL8d5Yg2EAtUMkEsuu6Y6kM9xH3Ip254LGC sgbwz7Ne2VCL1WeO95oHdzVJ7Wq2NfBnRLE95o+tHW1oYKR4t4jYjKWiJ8tRdi+lZFP4 NZlHRJqKURFjPjJ8WN1nFwsKoX+7whjtmSjjd0CsZoHvKyct+liT2Yx2nmsfFBvskgF9 DDcAixFKvBC8fhJnbvl2Q2n5x9IodYDECZucvlmIX1ebyWSfvXmjPkVzAqTe2VdZ1L80 y4mZejEby+Nu6yUSze3ebZZ8Q4lQ8Lbp3wa2xbSkx/g0uVKSIifIByU9BfkfPQ0sieeP bXUw== X-Gm-Message-State: APjAAAXU87KlhysJGYbdD5vhaSKZl2Wq0RZl+NwWXnV/ybesALUGGScb 5EVTXjxeufKFyPr95TYykaV6Ug== X-Google-Smtp-Source: APXvYqyKC+BzXedmEYnrmscZes6YbiO1vBpoeyLZ8XuVlvzicdpKdB/5c8l+RzxQwLiXQJz8nPa/9Q== X-Received: by 2002:adf:e84f:: with SMTP id d15mr6968942wrn.201.1571490511208; Sat, 19 Oct 2019 06:08:31 -0700 (PDT) Received: from localhost (cst-prg-73-11.cust.vodafone.cz. [46.135.73.11]) by smtp.gmail.com with ESMTPSA id r18sm8863748wme.48.2019.10.19.06.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Oct 2019 06:08:30 -0700 (PDT) Date: Sat, 19 Oct 2019 15:08:26 +0200 From: Tomas Vondra To: Tom Lane Cc: Morris de Oryx , pgsql-general Subject: Re: Has there been any discussion of custom dictionaries being defined in the database? Message-ID: <20191019130826.usuxx5k7rhwmmnr5@development> References: <19354.1571301238@sss.pgh.pa.us> <19760.1571305959@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <19760.1571305959@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Oct 17, 2019 at 11:52:39AM +0200, Tom Lane wrote: >Morris de Oryx writes: >> Given that Amazon is bragging this week about turning off Oracle, it seems >> like they could kick some resources towards contributing something to the >> Postgres project. With that in mind, is the idea of defining dictionaries >> within a table somehow meritless, or unexpectedly difficult? > >Well, it'd just be totally different. I don't think anybody cares to >provide two separate definitions of common dictionaries (which'd have to >somehow be kept in sync). > >As for why we did it with external text files in the first place --- >for at least some of the dictionary types, the point is that you can >drop in data files that are available from upstream sources, without any >modification. Getting the same info into a table would require some >nonzero amount of data transformation. > IMHO being able to load dictionaries from a table would be quite useful, and not just because of RDS. For example, it's not entirely true we're just using the upstream dictionaries verbatim - it's quite common to add new words, particularly in specialized fields. That's way easier when you can do that through a table and not through a file. >Having said that ... in the end a dictionary is really just a set of >functions implementing the dictionary API; where they get their data >from is their business. So in theory you could roll your own >dictionary that gets its data out of a table. But the dictionary API >would be pretty hard to implement except in C, and I bet RDS doesn't >let you install your own C functions either :-( > Not sure. Of course, if we expect the dictionary to work just like the ispell one, with preprocessing the dictionary into shmem, then that requires C. I don't think that's entirely necessary, thoug - we could use the table directly. Yes, that would be slower, but maybe it'd be sufficient. But I think the idea is ultimately that we'd implement a new dict type in core, and people would just specify which table to load data from. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services