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 1mdxL7-00042U-NY for pgsql-www@arkaria.postgresql.org; Fri, 22 Oct 2021 16:24:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mdxL5-0005yc-57 for pgsql-www@arkaria.postgresql.org; Fri, 22 Oct 2021 16:24:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdxL4-0005yS-QS for pgsql-www@lists.postgresql.org; Fri, 22 Oct 2021 16:24:14 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mdxL1-0001kl-4Q for pgsql-www@lists.postgresql.org; Fri, 22 Oct 2021 16:24:13 +0000 Received: by mail-lj1-x236.google.com with SMTP id 145so1731352ljj.1 for ; Fri, 22 Oct 2021 09:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QGWsMl67HlQVAlKm2ipPyd3eKqyLSLf2UJ0AvkN47R4=; b=qKIc8OhjF6i6cvqjLudOfpK26GUQx+J64XHM9EQhz4xCstevq5C1sTI5EVIsaaKtVG LIk01gf1VgsQE/cYGPs+Hu5rfnZICt+xS28rISD+PDawyNIxlUkx5qW0vQn6KL0oAakM BRDx4YI28xxOV2VZwtRXcV9B2c8JLt7iNwCwOcP20OfBFXkVxmyFKdv05eWYPAn5sayh 5XxcCZmOFl5BCF8um/Xy1KQ4tx6zpURtCdK1mXzKUgSmLdVSc7OLTz0vTev7YIyiFrt5 cWcCrr1FTNgmsyOXBrwFmmdMWEgKjGLRehwZoCH7xJHJuTkP4eKv3EvKliirNAA1GuOl lexA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QGWsMl67HlQVAlKm2ipPyd3eKqyLSLf2UJ0AvkN47R4=; b=DesRoVu8zwg6uCfvwrk7152xwK+rHEwtLEJ+TQ1toNjFPT/Ulb3cRlm3LWPskNVTP3 lQNX6on1e+9s7xUd+w22nmK2Jyej3NVYbMBpdUwteCc59n6MoLMz5tB4SLKSKh27OqmJ v2m9YbMppAz5r/c4oBSZv7CduO7D4v+/HFwc6t46ZRxx9SaNnqNDo1WPcqYnVNSlegAh gefmZ8P9pW5q8loXFFZL8LJMvsAi8FfsvYaQS6rdyWf202EpUcsQ1yHlhLPrb+CR1ePw /NagQH5Nkk+UakNBcMWKPlyq10ra9OpD9sO/gDEBGoglR4xKOpnxRSDOyaEJ/2nqjYCe ZhtA== X-Gm-Message-State: AOAM533S5RXLOnnCZ4kw3hWJMJ9hnPavuMIDEK/2rmTgOsFShxp3H5rG hSsjMa23dq2VSubLEM1C0rOLKWNwzpdOxbVgYBAJ1w== X-Google-Smtp-Source: ABdhPJxObvpuG+IPiqfBKGtTCLiTvtNgQDARAd0bb8KsgDlZMzVZO41M8tpbvSRo4CWrbtljw4+352G3FJAHNNwtUY4= X-Received: by 2002:a2e:a710:: with SMTP id s16mr958984lje.444.1634919849986; Fri, 22 Oct 2021 09:24:09 -0700 (PDT) MIME-Version: 1.0 References: <0d7d2e12-bdf9-8b7b-4b90-8380eeef7c16@postgresql.org> In-Reply-To: <0d7d2e12-bdf9-8b7b-4b90-8380eeef7c16@postgresql.org> From: Magnus Hagander Date: Fri, 22 Oct 2021 18:23:58 +0200 Message-ID: Subject: Re: [PATCH] pgweb: Add SEARCH_DSN to example settings.py To: "Jonathan S. Katz" Cc: =?UTF-8?Q?C=C3=A9lestin_Matte?= , PostgreSQL WWW Content-Type: multipart/alternative; boundary="000000000000e51de205cef37012" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e51de205cef37012 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 22, 2021 at 6:10 PM Jonathan S. Katz wrote: > On 10/22/21 11:08 AM, C=C3=A9lestin Matte wrote: > > Hello, > > > > Defining SEARCH_DSN is necessary to install the search functionality in > pgweb, although this is not explained anywhere. > > This patch adds SEARCH_DSN in the example settings.py so that users kno= w > that this variable must be defined. > > ...this perhaps explains why I've never gotten the search utility to > work in my local environment. > > In general I'm OK with this, but perhaps we leave the string empty with > instructions to fill the connection string to the DB that is hosting the > search schema. > I think having a default like in this patch is better. Otherwise it could randomly connect to a database with the same name as the user for example, which might actually happen in dev scenarios. So if we want it empty we'd also need to add code to check if it's set or not before trying to use it - seems easier to set the default and have it fail :) --=20 Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/ --000000000000e51de205cef37012 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Oct 22, 2021 at 6:10 PM Jonat= han S. Katz <jkatz@postgresql.or= g> wrote:
On 10/22/21 11:08 AM, C=C3=A9lestin Matte wrote:
> Hello,
>
> Defining SEARCH_DSN is necessary to install the search functionality i= n pgweb, although this is not explained anywhere.
> This patch adds SEARCH_DSN in the example settings.py so that users kn= ow that this variable must be defined.

...this perhaps explains why I've never gotten the search utility to work in my local environment.

In general I'm OK with this, but perhaps we leave the string empty with=
instructions to fill the connection string to the DB that is hosting the search schema.

I think having a default= like in this patch is better. Otherwise it could randomly connect to a dat= abase with the same name as the user for example, which might actually happ= en in dev scenarios. So if we want it empty we'd also need to add code = to check if it's set or not before trying to use it - seems easier to s= et the default and have it fail :)

--
=C2=A0Magnus Haga= nder
=C2=A0Me: ht= tps://www.hagander.net/
=C2=A0Work: https://www.redpill-linpro.com/
--000000000000e51de205cef37012--