From: Chris Hanson Date: Thu, 25 Nov 2004 04:00:21 +0000 (+0000) Subject: Force loading of pgsql from ESCAPE-PGSQL-STRING. X-Git-Tag: 20090517-FFI~1435 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=110f67c1b100d2b2f4b42140b6848825c5ef0750;p=mit-scheme.git Force loading of pgsql from ESCAPE-PGSQL-STRING. --- diff --git a/v7/src/runtime/pgsql.scm b/v7/src/runtime/pgsql.scm index e6297c9a8..785c89254 100644 --- a/v7/src/runtime/pgsql.scm +++ b/v7/src/runtime/pgsql.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: pgsql.scm,v 1.8 2003/11/11 04:46:39 cph Exp $ +$Id: pgsql.scm,v 1.9 2004/11/25 04:00:06 cph Exp $ Copyright 2003 Massachusetts Institute of Technology @@ -157,6 +157,10 @@ USA. set-result-handle!)) (set! pgsql-initialized? #t))) #t))) + +(define (guarantee-pgsql-available) + (if (not (pgsql-available?)) + (error "No PostgreSQL support in this sytem."))) (define condition-type:pgsql-error (make-condition-type 'PGSQL-ERROR condition-type:error '() @@ -207,8 +211,7 @@ USA. (write-string "." port))) (define (open-pgsql-conn parameters #!optional wait?) - (if (not (pgsql-available?)) - (error "No PostgreSQL support in this sytem.")) + (guarantee-pgsql-available) (let ((wait? (if (default-object? wait?) #t wait?))) (make-gc-finalized-object connections @@ -280,6 +283,7 @@ USA. (index->name (pq-status (connection->handle connection)) connection-status)) (define (escape-pgsql-string string) + (guarantee-pgsql-available) (let ((escaped (make-string (fix:* 2 (string-length string))))) (set-string-maximum-length! escaped (pq-escape-string string escaped)) escaped)) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 23f9b83c4..1c3df74b1 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.517 2004/11/19 07:14:49 cph Exp $ +$Id: runtime.pkg,v 14.518 2004/11/25 04:00:21 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -4707,6 +4707,7 @@ USA. condition-type:pgsql-query-error escape-pgsql-string exec-pgsql-query + guarantee-pgsql-available make-empty-pgsql-result open-pgsql-conn pgsql-available?