Skip to content

Instantly share code, notes, and snippets.

View martinov's full-sized avatar

Martin Martinov martinov

View GitHub Profile
@martinov
martinov / all-json-fields-in-db.sql
Last active August 24, 2022 14:57
List all JSON and JSONB fields in given Postgres DB
-- Source: https://dataedo.com/kb/query/postgresql/find-all-json-columns
select col.table_schema,
col.table_name,
col.ordinal_position as column_id,
col.column_name,
col.data_type
from information_schema.columns col
join information_schema.tables tab on tab.table_schema = col.table_schema
and tab.table_name = col.table_name
#!/bin/bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer another-super-secret-key" \
-d @"${0%/*}/data.json" \
http://dikar-consult.mmartinov.com:3030/incoming-order