Received: from clubserv.rp-online.de (clubserv.rp-online.de [149.221.232.11]) by hub.org (8.9.2/8.9.1) with ESMTP id FAA58305 for ; Sat, 6 Mar 1999 05:29:06 -0500 (EST) (envelope-from Michael.Meskes@gmx.net) Received: from pc63.meskes.de (as13-077.rp-plus.de [149.221.92.205]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id LAA00674 for ; Sat, 6 Mar 1999 11:28:52 +0100 (MET) Received: (from meskes@localhost) by pc63.meskes.de (8.9.3/8.9.3/Debian/GNU) id PAA11198 for pgsql-interfaces@postgreSQL.org; Fri, 5 Mar 1999 15:49:46 +0100 Date: Fri, 5 Mar 1999 15:49:45 +0100 From: Michael Meskes To: PgSQL Interfaces Subject: Re: [INTERFACES] ECPG & 'exec sql connect to' question Message-ID: <19990305154945.A11186@gmx.net> Mail-Followup-To: PgSQL Interfaces References: <003601be6658$78d78ce0$2685d4c2@server.fonet2.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <003601be6658$78d78ce0$2685d4c2@server.fonet2.cz>; from Pavel PaJaSoft Janousek on Thu, Mar 04, 1999 at 05:01:05PM +0100 On Thu, Mar 04, 1999 at 05:01:05PM +0100, Pavel PaJaSoft Janousek wrote: > 'exec sql connect to unix:postgresql://localhost:5432/mm; ' > > I thought, that this example is for ECPG, but.... It is. However, the same dbname syntax applies to all programs using libpq. > All described this I make by psql monitor... I create database 'test'. Database 'test' is created by unix user 'paja' ('paja' is postgres user too). I create new postgres user 'petr' with password 'petr'. As 'paja', I connect to database 'test' and create table 'pom' with some cols, then execute this: 'grant insert on pom to petr;'. All is OK, but now, I want connect to database 'test' by user 'petr'... of course, I cant' use simple command: > 'exec sql connect 'test';', because I want have only rights as user 'petr' (only inserting rows). > My problem is, that I don't know, how I can connect to database (on > local system or remote...) with specifiing user and his password. I > know, that I can use libpq directly, but I want do this by ECPG, not > by using the PostgreSQL C library. the syntax is 'exec sql user identified by ' > PS: A wrote this question in november 1998, but I didn't got some answer. > Of course, I specify my question rather diferent... Seems I missed it. Sorry. 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!