WindmillWWindmill
Powered by
amgfredA
Windmill•2y ago•
6 replies
amgfred

How to insert JSONB parameter in Postgres Action

Hiya folks,
Can't see what I'm missing here. I have a Postgres action as below:
-- $1 data

INSERT INTO table (data)
VALUES (cast($1 as jsonb));
-- $1 data

INSERT INTO table (data)
VALUES (cast($1 as jsonb));

but I get
ExecutionErr: error during execution of the script: db error: ERROR: unsupported jsonb version number 39
ExecutionErr: error during execution of the script: db error: ERROR: unsupported jsonb version number 39

VALUES ($1::JSONB)
VALUES ($1::JSONB)
doesn't work either.
The parameter I'm using (e.g.
'{"some": "data"}'
'{"some": "data"}'
works directly in the query:
INSERT INTO table (data)
VALUES ('{"some": "data"}');
INSERT INTO table (data)
VALUES ('{"some": "data"}');


Windmill expects a
string
string
type as the parameter.
I've checked the docs but couldn't find anything.
Thaaanks!
image.png
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

How do I use a Windmill Postgres script to insert a date field?
Trevor SullivanTTrevor Sullivan / help
3y ago
How to pass sql query parameter
Ask InkeepAAsk Inkeep / help
2y ago
Database Manager JSONB Error
fooosieeeFfooosieee / help
2w ago
Cannot convert between String and JSONB in PostgreSQL
ShenanigansSShenanigans / help
9mo ago