Received: from trends.net (root@clio.trends.ca [209.47.148.2]) by hub.org (8.9.1/8.9.1) with ESMTP id NAA03794 for ; Thu, 21 Jan 1999 13:59:52 -0500 (EST) (envelope-from Michael.Meskes@gmx.net) Received: from clubserv.rp-online.de (root@clubserv.rp-online.de [149.221.232.11]) by trends.net (8.8.8/8.8.8) with ESMTP id NAA24012 for ; Thu, 21 Jan 1999 13:36:48 -0500 (EST) Received: from pc63.meskes.de (as13-023.rp-plus.de [149.221.92.151]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id TAA25170; Thu, 21 Jan 1999 19:35:33 +0100 (MET) Received: (from meskes@localhost) by pc63.meskes.de (8.9.1a/8.9.0/Debian/GNU) id JAA02872; Thu, 21 Jan 1999 09:31:17 +0100 Date: Thu, 21 Jan 1999 09:31:17 +0100 From: Michael Meskes To: James Thompson Cc: PostgreSQL Interfaces Subject: Re: [INTERFACES] EXEC SQL CONNECT Message-ID: <19990121093117.A2863@gmx.net> Mail-Followup-To: James Thompson , PostgreSQL Interfaces References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: ; from James Thompson on Wed, Jan 20, 1999 at 09:09:59PM -0600 On Wed, Jan 20, 1999 at 09:09:59PM -0600, James Thompson wrote: > I'm trying to use ecpg to connect to postgres Good. :-) > I've never used embedded sql in C though years ago I did use Pro*FORTRAN > for Oracle. Anyway how do I connect to a remote or local database in ecgs > passing in the database name, username, and password. The test programs > in the tarball don't seem to do this. The following is accepted syntax: exec sql connect to [as ] [user ] exec sql connect to default exec sql As for the database name you can choose two different sets of syntax: new style: :postgresql://server[:port][/dbname][?options] old style: style: dbname[@server][:port] Finally the user name can be written as: / identified by using Hope this helps. Michael -- Michael Meskes | Go SF 49ers! Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire! Tel.: (+49) 2431/72651 | Use Debian GNU/Linux! Email: Michael.Meskes@gmx.net | Use PostgreSQL!