diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-08-21 23:34:44 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-08-21 23:34:44 +0200 |
commit | 250e1997d86c160e1a6603c72b23bf1ec8eafb5d (patch) | |
tree | 9dfdfaab4fd32b14c7fcf35845565e901efed61d /src/pq/pq_common.h | |
parent | d1e242aa083cd108aca6e3ceda5f3459c8cebdc4 (diff) | |
download | exchange-250e1997d86c160e1a6603c72b23bf1ec8eafb5d.tar.xz |
postgres does not like 0-padding of VARCHAR, implement proper serialization
Diffstat (limited to 'src/pq/pq_common.h')
-rw-r--r-- | src/pq/pq_common.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pq/pq_common.h b/src/pq/pq_common.h index 4dc2d3357..dff5e4c89 100644 --- a/src/pq/pq_common.h +++ b/src/pq/pq_common.h @@ -74,6 +74,7 @@ struct TALER_PQ_AmountP */ struct TALER_PQ_AmountCurrencyP { + uint32_t cnt; /* number of OIDs in tuple */ uint32_t oid_v; /* oid of .v */ uint32_t sz_v; /* size of .v */ uint64_t v; /* value */ @@ -119,13 +120,16 @@ TALER_PQ_make_taler_pq_amount_ ( * @param oid_v OID of the INT8 type in postgres * @param oid_f OID of the INT4 type in postgres * @param oid_c OID of the TEXT type in postgres + * @param[out] rval set to encoded @a amount + * @return actual (useful) size of @a rval for Postgres */ -struct TALER_PQ_AmountCurrencyP +size_t TALER_PQ_make_taler_pq_amount_currency_ ( const struct TALER_Amount *amount, uint32_t oid_v, uint32_t oid_f, - uint32_t oid_c); + uint32_t oid_c, + struct TALER_PQ_AmountCurrencyP *rval); #endif /* TALER_PQ_COMMON_H_ */ |