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 1ioot9-0005Fn-3L for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jan 2020 13:27:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioot7-0000Ms-Qe for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jan 2020 13:27:13 +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 1ioot7-0000Ml-IV for pgsql-bugs@lists.postgresql.org; Tue, 07 Jan 2020 13:27:13 +0000 Received: from mail-lj1-f193.google.com ([209.85.208.193]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ioot5-0001pp-0r for pgsql-bugs@lists.postgresql.org; Tue, 07 Jan 2020 13:27:12 +0000 Received: by mail-lj1-f193.google.com with SMTP id h23so54736448ljc.8 for ; Tue, 07 Jan 2020 05:27:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=h9IH/IDmwOttB/TIEaVltwioxKeQHc1cNF8cYt1E+dg=; b=VuDCPjI5ZvsO9K6VWj0h+i199xv0pbuB0+sqXjV4/D9Anhc0+rlkSPQcwjunHjikiD Khr3GXKoozEBYFi85TtCQn9Y+grpJD0IoeewFYKxeUIKCn6nT/cLWaDFGvdv9XaG8DxX OHf/MYiW4tEOLrkCtY6RMMVknqf1QtEubIIHnyv12ohM/zoRqmZYHcU2jmKA1EHREVvr A34InZxWnHbTZwpHQZ9yhy6Z9lN4LtF+BLsj7eVF73m397k1i/2/QMjjLCJ/+DYtAfjy DgniZ1jvhYaIFuhDqCY9bKG4aha4wvr+KfBOHCDmQEGxFnbQBY9kl7ckf3fMU86WzJSu UDtw== X-Gm-Message-State: APjAAAUIkLerqSKaqzj5LQ07/Ovfji1uRBOLrLkXNtipI8yvbusXefLI MqZKFgGVAwmRT2loSJ+ycx5+metA X-Google-Smtp-Source: APXvYqwANnDPtWBczFafbFKWtTQ4j7w5aOsVWuVxIiAm16Mkkwwi1HGeCkGuoq4Qw76D76s+GTyqtg== X-Received: by 2002:a2e:9716:: with SMTP id r22mr63462322lji.224.1578403629875; Tue, 07 Jan 2020 05:27:09 -0800 (PST) Received: from [192.168.1.10] (dsl-hkibng22-54f980-150.dhcp.inet.fi. [84.249.128.150]) by smtp.gmail.com with ESMTPSA id o19sm36996723lji.54.2020.01.07.05.27.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2020 05:27:09 -0800 (PST) Subject: Re: libpq parameter parsing problem To: Jobin Augustine , pgsql-bugs@lists.postgresql.org References: From: Heikki Linnakangas Message-ID: <38896fd5-afe9-6922-0034-63d32a04cbcf@iki.fi> Date: Tue, 7 Jan 2020 15:27:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/01/2020 15:17, Jobin Augustine wrote: > Hello hackers, > User can pass session-level settings as a parameter in the connection > string like: > psql "host=localhost user=postgres options='-c synchronous_commit=off'" > Which sets the synchronous_commit off for the session. > > However, URI spec is not allowing it, > psql postgresql://postgres@localhost:5432/postgres?options="-c > synchronous_commit=off" > psql: error: could not connect to server: extra key/value separator "=" > in URI query parameter: "options" The "-c synchronous_commit=off" string is part of the value for the "options" keyword. So it needs to be URI encoded: psql "postgresql://postgres@localhost:5432/postgres?options=-c%20synchronous_commit%3Doff" - Heikki