dbd/postgresql/statement.c

changeset 33
6c64c45e7d8f
parent 32
03ed0ca09837
child 38
627506d80e5b
equal deleted inserted replaced
32:03ed0ca09837 33:6c64c45e7d8f
1 #include "dbd_postgresql.h" 1 #include "dbd_postgresql.h"
2
3 #define BOOLOID 16
4 #define INT2OID 21
5 #define INT4OID 23
6 #define INT8OID 20
7 #define FLOAT4OID 700
8 #define FLOAT8OID 701
2 9
3 static lua_push_type_t postgresql_to_lua_push(unsigned int postgresql_type) { 10 static lua_push_type_t postgresql_to_lua_push(unsigned int postgresql_type) {
4 lua_push_type_t lua_type; 11 lua_push_type_t lua_type;
5 12
6 switch(postgresql_type) { 13 switch(postgresql_type) {
26 return lua_type; 33 return lua_type;
27 } 34 }
28 35
29 static int deallocate(statement_t *statement) { 36 static int deallocate(statement_t *statement) {
30 char command[IDLEN+11]; 37 char command[IDLEN+11];
31 38 PGresult *result;
32 snprintf(command, IDLEN+11, "DEALLOCATE %s", statement->name); 39 ExecStatusType status;
33 40
34 PGresult *result = PQexec(statement->postgresql, command); 41 snprintf(command, IDLEN+11, "DEALLOCATE %s", statement->name);
35 ExecStatusType status; 42 result = PQexec(statement->postgresql, command);
36 43
37 if (!result) 44 if (!result)
38 return 1; 45 return 1;
39 46
40 status = PQresultStatus(result); 47 status = PQresultStatus(result);

mercurial