--OgqxwSJOaUobr8KG Content-Type: text/plain; charset=iso-2022-jp Content-Disposition: inline って肝心のパッチファイルを添付しわすれていました。(--; Tue, Aug 28, 2001 at 09:08:27PM +0900 において Shinobu TAKANASHI さん曰く: > PHP や Perl と同様に Ruby でも conninfo 形式("dbname ge user no ...") > で接続できるようにするパッチです。 > > conn Gconn.connect("dbname ge user no password gepass") > > 引数の数でしているので、今までの > > PGconn.connect(pghost, pgport, pgoptions, pgtty, dbname, login, passwd) > > 形式もまま使えます。 > > #あまり実用的価値はありませんが、なんとなく conninfo 形式に慣れて > #しまっているもので... -- Shinobu Takanashi <sino / kappe.co.jp> "ARS LONGA, VITA BREVIS" --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="postgres.c.diff" --- postgres.c Mon Apr 23 11:31:24 2001 +++ postgres.c.new Tue Aug 28 20:47:34 2001 @@ -57,7 +57,7 @@ VALUE *argv; VALUE pgconn; { - int i; +/* int i; */ VALUE arg[7]; char *pghost, *pgopt, *pgtty, *pgdbname, *pglogin, *pgpwd; int pgport 1; @@ -66,6 +66,7 @@ pghost opt tty dbname login pwd LL; pgport; + if(argc > 1){ rb_scan_args(argc,argv,"07", &arg[0], &arg[1], &arg[2], &arg[3], &arg[4], &arg[5], &arg[6]); if (!NIL_P(arg[0])) { @@ -104,6 +105,10 @@ conn QsetdbLogin(pghost, NULL, pgopt, pgtty, pgdbname, pglogin, pgpwd); } + }else if(argc 1){ + rb_scan_args(argc,argv,"01", &arg[0]); + conn Qconnectdb(STR2CSTR(arg[0])); + } if (PQstatus(conn) CONNECTION_BAD) { rb_raise(rb_ePGError, PQerrorMessage(conn)); --OgqxwSJOaUobr8KG--