Received: from www.flamingo.cz (root@fwd.cz [194.212.23.91]) by hub.org (8.9.2/8.9.1) with ESMTP id LAA50229 for ; Thu, 4 Mar 1999 11:04:31 -0500 (EST) (envelope-from janousek@fonet.cz) Received: from server (ts3-7.bm.cesnet.cz [194.212.133.38]) by www.flamingo.cz (8.8.8/8.8.8) with SMTP id RAA08956 for ; Thu, 4 Mar 1999 17:04:32 +0100 Message-ID: <003601be6658$78d78ce0$2685d4c2@server.fonet2.cz> From: "Pavel PaJaSoft Janousek" To: "PgSQL Interfaces" Subject: ECPG & 'exec sql connect to' question Date: Thu, 4 Mar 1999 17:01:05 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by hub.org id LAA50232 Hi all, I've one big problem. Last month I saw in this mailing-list one example, where was this line: 'exec sql connect to unix:postgresql://localhost:5432/mm; ' I thought, that this example is for ECPG, but.... I'm using PostgreSQL 6.4.2 - ECPG is from this release (without other patches, which are distributed in this mailing-list). I try compile my program, but I got always the same error: :: parse error at or near 'postgresql'. So, I write small example: 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. Thank you for any ideas.... Pavel PaJaSoft Janousek FoNet, spol. s r.o. PS: A wrote this question in november 1998, but I didn't got some answer. Of course, I specify my question rather diferent...