diff --git a/lib/modules/Sql.pmod/postgres.pike b/lib/modules/Sql.pmod/postgres.pike index 3310b487fd516f145218dbb0fc5b0f187ee8cd9c..a919f85b921847442e62a186c06b164a229ce88b 100644 --- a/lib/modules/Sql.pmod/postgres.pike +++ b/lib/modules/Sql.pmod/postgres.pike @@ -1,7 +1,7 @@ /* * This is part of the Postgres module for Pike. * - * $Id: postgres.pike,v 1.31 2008/07/04 09:38:40 srb Exp $ + * $Id: postgres.pike,v 1.32 2008/07/05 11:17:45 srb Exp $ * */ @@ -375,7 +375,7 @@ array(mapping(string:mixed)) list_fields (string table, void|string wild) //! recommend using @[query()] for simpler queries (because it is //! easier to handle, but stores all the result in memory), and //! @[big_query()] for queries you expect to return huge amounts of -//! data (it's harder to handle, but fectches results on demand). +//! data (it's harder to handle, but fetches results on demand). //! //! @note //! This function @b{can@} raise exceptions. diff --git a/src/modules/Postgres/pgresult.c b/src/modules/Postgres/pgresult.c index d17e9d5e92f2ec402df96389ceff65252ea6d5e1..b2b03ee974c2f9ab08bb1b957c01e63828850a26 100644 --- a/src/modules/Postgres/pgresult.c +++ b/src/modules/Postgres/pgresult.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: pgresult.c,v 1.35 2008/06/25 11:53:32 srb Exp $ +|| $Id: pgresult.c,v 1.36 2008/07/05 11:17:45 srb Exp $ */ /* @@ -55,6 +55,14 @@ * 20 characters', where in Postgres it means 'any string long exactly 20 * characters'. With Postgres you have to use type varchar otherwise, but * this makes its SQL incompatible with other servers'. + * + * Newer versions of Postgres seem to do this by themselves already. + * Newer meaning at least 7.4 and later. Since Postgres 7.4 is the oldest + * Postgres version that is still supported (by the Postgres team itself), + * we might as well drop support for any earlier versions as well. + * + * FIXME: test the CUT_TRAILING_SPACES macro, and delete it if it is already + * being done by the DB. */ #define CUT_TRAILING_SPACES @@ -257,8 +265,11 @@ static void f_fetch_fields (INT32 args) /* no default value information is availible */ push_text("type"); push_int(PQftype(res,j)); - /* ARGH! I'd kill 'em! How am I supposed to know how types are coded - * internally!?!?!?!? + /* ARGH! I'd kill 'em! How am I supposed to know how types are + * coded internally!?!?!?!? + * + * The internal encoding is well defined for the standard + * types (big endian). The problem are the extended types. */ push_text("length"); tmp=PQfsize(res,j); diff --git a/src/modules/Postgres/postgres.c b/src/modules/Postgres/postgres.c index 3e5520383e480ad9c12f9f20b7f3ca8a7fbefd65..be5d026785f27ab2585e3bff1bde03282d17a659 100644 --- a/src/modules/Postgres/postgres.c +++ b/src/modules/Postgres/postgres.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: postgres.c,v 1.63 2008/07/04 09:38:40 srb Exp $ +|| $Id: postgres.c,v 1.64 2008/07/05 11:17:45 srb Exp $ */ /* @@ -370,8 +370,9 @@ static void f_select_db (INT32 args) *! @note *! This function @b{can@} raise exceptions. *! - *! The program @[Sql.postgres_result] is exactly - *! the same as @[Postgres.postgres_result]. + *! The program @[Sql.postgres_result] is a superset of + *! the raw @[Postgres.postgres_result] which does not do chunking to + *! avoid excessive memory usage in case of large resultsets. *! *! @seealso *! @[Sql.Sql], @[Sql.sql_result]