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 1lJcwK-0004Nc-MF for psycopg@arkaria.postgresql.org; Tue, 09 Mar 2021 14:02:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJcwI-0000eZ-Ed for psycopg@arkaria.postgresql.org; Tue, 09 Mar 2021 14:02:22 +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 1lJcwI-0000eP-36 for psycopg@lists.postgresql.org; Tue, 09 Mar 2021 14:02:22 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lJcwD-0000Yx-6W for psycopg@postgresql.org; Tue, 09 Mar 2021 14:02:21 +0000 Received: by mail-lf1-x12b.google.com with SMTP id f1so27228394lfu.3 for ; Tue, 09 Mar 2021 06:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lbspVVmLsfSm01/b7uKfvoL58O+FjIZVvYQ97GSysZA=; b=NWYwgtl5dvPom19cadBAHV/6Lz+ufBp0brdnz+m1adAolAP6eTMJgc16NKSziQzWq1 veTFF1QtMlvfBlW5L1CdCTwEIhWzLTn/d5OcWAtbeYuU7jcPc7h5Ds+M4ly5asqjeSjf CHfw5NVpALkahg7JP/b/2rySY9XP9h5YQELyNlPPpuuuCW5J9sowt760A6FwsI/GWk5V 3MlH7lSwUudqnxdkMG6azMoqStT1ZahtUzK85doHarievB8qHmQUrKRh6XJNYLsCoI7i byrK4lXNwCb20acV0Fg7n85frvWHyBtwWuybiuboE6HsR+i9ejvkk37o9OfExmxko+dh YuHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lbspVVmLsfSm01/b7uKfvoL58O+FjIZVvYQ97GSysZA=; b=jqpWaSvedRPEVV22NhWcF4+d01dqSukQ22LEOJAy4CqZRvexO2X4O7jf3IZvR6K59H vjf3neDes47RutOoq7HCCUv1xWe9dAEUm7bBmCdNZvt2MY1qEmqzhpWwcD7WXNN8pnJ5 GiXau9Xb/1sXaSiPHT3WRlonwax3RODHHZV3VjjffRtY9Lk1azV9dht7JFJVmfygWGKv zpeUlwsTEzKN9hfooUzkGFkeNQdoNjbNFXvQoKC7WuvwlZ0RlKor9aGp8BYYqzOMLyUR r6PRyM+tSCgJgIjLhQ4yblZ9K5Ej7O9bP+yZmi/c+DMe9HqbSNMlyneKOds734q2u+QU /zOw== X-Gm-Message-State: AOAM5321rYnaGqmxWeeJPXf/2nzRQ2jRDATZsahs9MrP7k8cDaOBAtO0 PlMbqfElgFCuoOrr61l5EnLcf8btxXXhfzMutLM= X-Google-Smtp-Source: ABdhPJw0DLnbYQ72UygJ+W/a1QygHb2i+UBYTQnQfs7+GTGuBrQo57hVUDEgFIz5dJdEaefSYUxwQWzoyohYd45dTP4= X-Received: by 2002:a19:30c:: with SMTP id 12mr18208922lfd.102.1615298534584; Tue, 09 Mar 2021 06:02:14 -0800 (PST) MIME-Version: 1.0 References: <20210309104530.GN11758@artax.karlin.mff.cuni.cz> <20210309110619.GO11758@artax.karlin.mff.cuni.cz> <20210309115316.GP11758@artax.karlin.mff.cuni.cz> In-Reply-To: <20210309115316.GP11758@artax.karlin.mff.cuni.cz> From: Daniele Varrazzo Date: Tue, 9 Mar 2021 15:02:03 +0100 Message-ID: Subject: Re: connect using env. variables To: Hans Ginzel Cc: Sebastiaan Mannem , psycopg@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 9 Mar 2021 at 12:53, Hans Ginzel wrote: > > Thank you. > > Is there a reason why connect() must get the empty string as parametr, please? No, and I'm happy to make the dsn string optional, as you requested in github. psycopg3 already works this way and you can use connect(). I just wanted to point out that you can do what you want to do already: connecting using only the PG* env var or the parse_dsn() produce. It's one of these things that is ugly but has been that way for so long that we are used to it. Or better, which should have been fixed when we introduced the possibility to pass both the dsn string and the keywords to connect(), because in the past there was no parse_dsn() and facility to merge the two. Cheers -- Daniele