Displaying 11 results from an estimated 11 matches for "pgresult".
2010 Mar 26
2
Fix for the consume_results leak
I'm not really comfortable with making non-trivial changes to this
code but here is at least a fix for the PGresult leak (verified to
both apply to 1.2.11 and 2.0.beta4).
-----
--- dovecot/src/lib-sql/driver-pgsql.c 15 Mar 2010 18:18:14 -0000 1.1.1.2
+++ dovecot/src/lib-sql/driver-pgsql.c 26 Mar 2010 14:13:18 -0000 1.1.1.2.4.1
@@ -247,6 +247,17 @@
return 0;
}
+static inline int more_results(PGconn *pg)
+{...
2010 Dec 06
1
SQL codes on Controller
I use the SQL code in the controller as follow:
sql = ActiveRecord::Base.connection();
@countlikes = sql.execute("SELECT COUNT(rateint) as result FROM
rates");
But it returns the resuls as #<PGresult:0xb6ea00e0> in the view i.e.
@countlikes = #<PGresult:0xb6ea00e0>
I wanted the integer value. I am wondering how to use sql codes in the
controller
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,...
2010 Apr 14
4
PostgreSQL driver supporting [round-robin] load balancing and redundancy [LONG]
...p;
+ v->next_row = error_result_next_row;
+ v->get_error = error_result_get_error;
+
+ result->msg = (char *)msg;
+
+ dprintf(("%s: %p", __func__, result));
+}
+
+/** multi_pgsql_result */
+struct multi_pgsql_result {
+ struct sql_result api;
+ struct multi_pgsql_pgc *pgc;
+
+ PGresult *pgr;
+ unsigned row, n_rows;
+ char const **values, *errmsg;
+};
+
+/*** methods/ subroutines */
+static void multi_pgsql_result_free(struct sql_result *r)
+{
+ struct multi_pgsql_result *result;
+
+ result = (void *)r;
+
+ PQclear(result->pgr);
+ if (result->values) i_free(result->valu...
2010 Mar 25
2
A questions about consume_results (driver-pgsql.c)
Code
--------------
static void consume_results(struct pgsql_db *db)
{
do {
if (!PQconsumeInput(db->pg))
break;
if (PQisBusy(db->pg))
return;
} while (PQgetResult(db->pg) != NULL);
if (PQstatus(db->pg) == CONNECTION_BAD)
io_remove_closed(&db->io);
else
io_remove(&db->io);
db->querying = FALSE;
if (db->queue != NULL && db->connected)
2004 Jun 23
0
UPDATE Patch for postgres enabled app_voicemail.c
...**
*** 253,270 ****
}
ast_mutex_init(&postgreslock);
! /* fprintf(stderr,"postgres login OK\n"); */
return(0);
}
! static void sql_close(void)
{
! PQfinish(dbhandler);
}
static struct ast_vm_user *find_user(struct ast_vm_user *ivm, char
*context, char *mailbox)
{
PGresult *PGSQLres;
--- 269,371 ----
}
ast_mutex_init(&postgreslock);
! fprintf(stderr,"postgres login OK\n");
return(0);
}
!
! static void sql_append_mailboxes(void)
{
! /*
! * Matt Davies (aka JMD)
! * matt@bastionits.com
! * Bastion Information Technology Solutions
! *
! * add...
2004 Jun 23
0
Patch for postgres enabled app_voicemail.c
...**
*** 253,270 ****
}
ast_mutex_init(&postgreslock);
! /* fprintf(stderr,"postgres login OK\n"); */
return(0);
}
! static void sql_close(void)
{
! PQfinish(dbhandler);
}
static struct ast_vm_user *find_user(struct ast_vm_user *ivm, char
*context, char *mailbox)
{
PGresult *PGSQLres;
--- 269,371 ----
}
ast_mutex_init(&postgreslock);
! fprintf(stderr,"postgres login OK\n");
return(0);
}
!
! static void sql_append_mailboxes(void)
{
! /*
! * Matt Davies (aka JMD)
! * matt@bastionits.com
! * Bastion Information Technology Solutions
! *
! * add...
2004 Oct 05
1
Cannot compile Meetme2
...in.)
app_meetme2.c:31:22: libpq-fe.h: No such file or directory
app_meetme2.c: In function `launch_query':
app_meetme2.c:139: error: `PGconn' undeclared (first use in this function)
app_meetme2.c:139: error: `conn' undeclared (first use in this function)
app_meetme2.c:140: error: `PGresult' undeclared (first use in this function)
app_meetme2.c:140: error: `res' undeclared (first use in this function)
app_meetme2.c:153: error: `CONNECTION_BAD' undeclared (first use in this
function)
app_meetme2.c:164: error: `PGRES_TUPLES_OK' undeclared (first use in this
function)...
2004 Jun 08
1
Meetme2
...nch_query':
app_meetme2.c:139: `PGconn' undeclared (first use in this function)
app_meetme2.c:139: (Each undeclared identifier is reported only once
app_meetme2.c:139: for each function it appears in.)
app_meetme2.c:139: `conn' undeclared (first use in this function)
app_meetme2.c:140: `PGresult' undeclared (first use in this function)
app_meetme2.c:140: `res' undeclared (first use in this function)
app_meetme2.c:142: `MYSQL' undeclared (first use in this function)
app_meetme2.c:142: parse error before "myconn"
app_meetme2.c:143: `MYSQL_RES' undeclared (first use...
2005 Mar 05
2
cant compile app_meetme2
...error: `PGconn' undeclared (first use in this function)
app_meetme2.c:138: error: (Each undeclared identifier is reported only once
app_meetme2.c:138: error: for each function it appears in.)
app_meetme2.c:138: error: `conn' undeclared (first use in this function)
app_meetme2.c:139: error: `PGresult' undeclared (first use in this function)
app_meetme2.c:139: error: `res' undeclared (first use in this function)
app_meetme2.c:151: warning: implicit declaration of function `PQsetdbLogin'
app_meetme2.c:152: warning: implicit declaration of function `PQstatus'
app_meetme2.c:152: err...
2010 Aug 20
0
Problem with db:create
...sername-", "adapter"=>"postgresql",
"database"=>"argh_development", "host"=>"127.0.0.1", "pool"=>5,
"password"=>"-my password-"}
NoMethodError: undefined method `fformat'' for #<PGresult:0xb6706be0>:
SHOW client_min_messages
What happens?
My database.yml is looking like this:
# PostgreSQL. Versions 7.4 and 8.x are supported.
#
# Install the ruby-postgres driver:
# gem install ruby-postgres
# On Mac OS X:
# gem install ruby-postgres -- --include=/usr/local/pgsql...
2006 Apr 21
4
Bus error in ./script/console with postgres (ext. library)
...quot;Site_development", "postgres")
=> #<PGconn:0x5b0b8>
irb(main):003:0> conn.db
=> "Site_development"
irb(main):004:0> res = conn.exec("select count(*) from content")
LOG: duration: 10.191 ms statement: select count(*) from content
=> #<PGresult:0x556a4>
irb(main):005:0> res.fields
=> ["count"]
irb(main):006:0> res.getvalue(0,0)
=> "560"
--------
Obviously, the console isn''t doing something right... but I can''t figure
out what that is...
-ch
--
Posted via http://www.ruby-forum.com/...