diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/hstore/hstore_io.c | 10 | ||||
-rw-r--r-- | contrib/jsonb_plpython/jsonb_plpython.c | 9 | ||||
-rw-r--r-- | contrib/pg_prewarm/autoprewarm.c | 20 |
3 files changed, 24 insertions, 15 deletions
diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c index 7a741a779c8..745497c76f0 100644 --- a/contrib/hstore/hstore_io.c +++ b/contrib/hstore/hstore_io.c @@ -1462,10 +1462,14 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS) HSTORE_VALLEN(entries, i)); if (IsValidJsonNumber(tmp.data, tmp.len)) { + Datum numd; + val.type = jbvNumeric; - val.val.numeric = DatumGetNumeric( - DirectFunctionCall3(numeric_in, - CStringGetDatum(tmp.data), 0, -1)); + numd = DirectFunctionCall3(numeric_in, + CStringGetDatum(tmp.data), + ObjectIdGetDatum(InvalidOid), + Int32GetDatum(-1)); + val.val.numeric = DatumGetNumeric(numd); } else { diff --git a/contrib/jsonb_plpython/jsonb_plpython.c b/contrib/jsonb_plpython/jsonb_plpython.c index 08a7598aae3..645238f15b3 100644 --- a/contrib/jsonb_plpython/jsonb_plpython.c +++ b/contrib/jsonb_plpython/jsonb_plpython.c @@ -325,8 +325,13 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum) PG_TRY(); { - num = DatumGetNumeric(DirectFunctionCall3(numeric_in, - CStringGetDatum(str), 0, -1)); + Datum numd; + + numd = DirectFunctionCall3(numeric_in, + CStringGetDatum(str), + ObjectIdGetDatum(InvalidOid), + Int32GetDatum(-1)); + num = DatumGetNumeric(numd); } PG_CATCH(); { diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c index bb28e237d17..9faabe576dd 100644 --- a/contrib/pg_prewarm/autoprewarm.c +++ b/contrib/pg_prewarm/autoprewarm.c @@ -180,8 +180,8 @@ autoprewarm_main(Datum main_arg) { LWLockRelease(&apw_state->lock); ereport(LOG, - (errmsg("autoprewarm worker is already running under PID %d", - apw_state->bgworker_pid))); + (errmsg("autoprewarm worker is already running under PID %lu", + (unsigned long) apw_state->bgworker_pid))); return; } apw_state->bgworker_pid = MyProcPid; @@ -290,8 +290,8 @@ apw_load_buffers(void) { LWLockRelease(&apw_state->lock); ereport(LOG, - (errmsg("skipping prewarm because block dump file is being written by PID %d", - apw_state->pid_using_dumpfile))); + (errmsg("skipping prewarm because block dump file is being written by PID %lu", + (unsigned long) apw_state->pid_using_dumpfile))); return; } LWLockRelease(&apw_state->lock); @@ -580,12 +580,12 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged) { if (!is_bgworker) ereport(ERROR, - (errmsg("could not perform block dump because dump file is being used by PID %d", - apw_state->pid_using_dumpfile))); + (errmsg("could not perform block dump because dump file is being used by PID %lu", + (unsigned long) apw_state->pid_using_dumpfile))); ereport(LOG, - (errmsg("skipping block dump because it is already being performed by PID %d", - apw_state->pid_using_dumpfile))); + (errmsg("skipping block dump because it is already being performed by PID %lu", + (unsigned long) apw_state->pid_using_dumpfile))); return 0; } @@ -717,8 +717,8 @@ autoprewarm_start_worker(PG_FUNCTION_ARGS) if (pid != InvalidPid) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("autoprewarm worker is already running under PID %d", - pid))); + errmsg("autoprewarm worker is already running under PID %lu", + (unsigned long) pid))); apw_start_master_worker(); |