db_unlock(mdb);
}
-static int64_t my_postgresql_currval(B_DB *mdb, const char *table_name)
+static uint64_t my_postgresql_currval(B_DB *mdb, const char *table_name)
{
// Obtain the current value of the sequence that
// provides the serial value for primary key of the table.
char sequence[NAMEDATALEN-1];
char query [NAMEDATALEN+50];
PGresult *result;
- int64_t id = 0;
+ uint64_t id = 0;
if (strcasecmp(table_name, "basefiles") == 0) {
bstrncpy(sequence, "basefiles_baseid", sizeof(sequence));
if (PQresultStatus(result) == PGRES_TUPLES_OK) {
Dmsg0(500, "getting value");
- id = str_to_int64(PQgetvalue(result, 0, 0));
+ id = str_to_uint64(PQgetvalue(result, 0, 0));
Dmsg2(500, "got value '%s' which became %d\n", PQgetvalue(result, 0, 0), id);
} else {
Dmsg1(50, "Result status failed: %s\n", query);
return id;
}
-int64_t my_postgresql_insert_autokey_record(B_DB *mdb, const char *query, const char *table_name)
+uint64_t my_postgresql_insert_autokey_record(B_DB *mdb, const char *query, const char *table_name)
{
/*
* First execute the insert query and then retrieve the currval.