Re: Psycopg2 : error message.

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Psycopg2 : error message.
Date: 2014-05-16 19:05:13
Message-ID: 53766169.8000404@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/16/2014 08:07 AM, skeeved wrote:
> Looks like you have an invalid connection string:
>
> conn=psycopg2.connect("dbname='busard_test' user='laurent' host='localhost' password='cactus’")
>
> Try removing the double quotes, they are obscuring the parameter names and values:
>
> conn=psycopg2.connect(dbname=‘busard_test', user=‘laurent', host=‘localhost', password='cactus’)
>
> You were also missing some punctuation between the parameters.

See below for the two ways of specifying connection parameters:

http://initd.org/psycopg/docs/module.html#psycopg2.connect

The OPs way is correct, the only thing is the single quotes are redundant.

>
> --
> skeeved
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-05-16 19:12:11 Re: Psycopg2 : error message.
Previous Message John R Pierce 2014-05-16 17:53:37 Re: Questions about DB capabilities