Fri, 24 Dec 2010 00:34:04 +0000
Make calling autocommit with the same value as set a NOOP to suppress a warning from the DB
1 | 1 | #include <libpq-fe.h> |
33 | 2 | #include <postgres_fe.h> |
1 | 3 | #include <dbd/common.h> |
4 | ||
2 | 5 | /* |
6 | * length of a prepared statement ID | |
30
8599f34c139b
Add 'columns' method to statement handles to retrieve column names from a result set
nrich@ii.net
parents:
13
diff
changeset
|
7 | * dbd-postgresql-\d{17}\0 |
2 | 8 | */ |
30
8599f34c139b
Add 'columns' method to statement handles to retrieve column names from a result set
nrich@ii.net
parents:
13
diff
changeset
|
9 | #define IDLEN 15+17+1 |
1 | 10 | |
11 | #define DBD_POSTGRESQL_CONNECTION "DBD.PostgreSQL.Connection" | |
12 | #define DBD_POSTGRESQL_STATEMENT "DBD.PostgreSQL.Statement" | |
13 | ||
2 | 14 | /* |
15 | * connection object implentation | |
16 | */ | |
1 | 17 | typedef struct _connection { |
18 | PGconn *postgresql; | |
13
10c8c6f0da14
Added connection:autocommit(), connection:commit(), and connection:rollback() to control transactions.
nrich@ii.net
parents:
2
diff
changeset
|
19 | int autocommit; |
2 | 20 | unsigned int statement_id; /* sequence for statement IDs */ |
1 | 21 | } connection_t; |
22 | ||
2 | 23 | /* |
24 | * statement object implementation | |
25 | */ | |
1 | 26 | typedef struct _statement { |
27 | PGconn *postgresql; | |
28 | PGresult *result; | |
2 | 29 | char name[IDLEN]; /* statement ID */ |
30 | int tuple; /* number of rows returned */ | |
1 | 31 | } statement_t; |
32 |