On Mon, 2006-09-25 at 08:25 -0300, Stephen Chisholm wrote: > On Sat, Sep 23, 2006 at 11:08:05AM -0400, Rick Morrison wrote: > > > I think that psycopg2 will automatically use a Unix socket if a host address > > is omitted on the connection call. You'd need a way to have SA not supply > > that -- not sure how that would fit in with the dburi way of things. What's > > the big deal with using localhost anyway? I was under the impression that it > > was optimized for most of the Unixen and BSDs out there to be about as fast > > as a socket anyway. > > You cannot do it with the URL based syntax.
I was looking for info related to this issue and found this thread. Turns out you can simply do: postgres:///dbname?host=/path/to/socket Which I find to be entirely satisfactory (frankly I despise this connection syntax but TurboGears forces it on you). Regards, Cliff > > On 9/23/06, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > > > on my machine, I am able to connect if I simply say: > > > > create_engine('postgres://user:pass@/dbname') > > > > i would assume that its dropping into a unix socket. im not an > > expert at reading the unix sockets listing on OSX's netstat but I > > also see an additional "PGSQL.5432" entry pop up when I run this. > > Here is a method that works: > > If one runs a postgres server listening _only_ a Unix socket this code > below shows how to connect and SA engine to it. > > import sqlalchemy as sa > > conn_args = { > 'host':'/tmp/pg', > 'database':'t-design', > } > > db = sa.create_engine('postgres://', connect_args = conn_args) > > Cheers, > Steve > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users