| BML-S | Help Login

Last entries

    20241021.1402
  1. postgres|jsonb > Update JSON Data in PostgreSQL - [s]

    UPDATE blob_store_configuration set attributes = jsonb_set(attributes, '{s3, accessKeyId}','"XXXXXXXXXXXXXXXXXXX"') where name = 's3-test';

  2. 20241016.1448
  3. postgres|postgresql|flyway > check|list status of advisory lock - [s]

  4. 20241016.1245
  5. postgres|postgresql > How to Resolve pg_wal Running Out of Disk Space - [s]

    $ pg_controldata -D /opt/homebrew/var/postgresql@14 pg_control version number: 1300 Catalog version number: 202107181 Database system identifier: 7156816885991412919 Database cluster state: in production pg_control last modified: Tue 15 Oct 18:01:00 2024 Latest checkpoint location: 97/5D384BB0 Latest checkpoint's REDO location: 97/5D384B78 Latest checkpoint's REDO WAL file: 00000001000000970000005D <<< Latest checkpoint's TimeLineID: 1 ... Time of latest checkpoint: Tue 15 Oct 18:01:00 2024 ... # Simulating/testing WAL file cleanup $ cd "/opt/homebrew/var/postgresql@14" $ ls -l ./pg_wal/00000001000000970000005D -rw------- 1 hosako admin 16777216 15 Oct 18:01 ./pg_wal/00000001000000970000005D $ pg_archivecleanup -n -d ./pg_wal/ 00000001000000970000005D pg_archivecleanup: keeping WAL file "./pg_wal//00000001000000970000005D" and later

  6. 20241016.1232
  7. The Power of JSONB in PostgreSQL. PostgreSQL is a powerful relational… | by Mohammad Roshandelpoor | Medium - [s]

    -> : Extracts a JSON element by key or array index. ->> : Extracts a JSON element as text. #> : Extracts a JSON sub-object at a specified path. #>> : Extracts a JSON sub-object as text. @> : Checks if a JSON document contains another JSON document. <@ : Checks if a JSON document is contained within another JSON document. jsonb_array_elements(): Expands a JSON array into a set of rows. jsonb_each(): Expands a JSON object into key-value pairs. ---- -- Access the first element in the 'ids' array within 'params' SELECT params->'ids'->0 FROM events; -- Check if the employee has a skill in "Sales" SELECT * FROM employees WHERE employee_data->'skills' @> '["Sales"]'; ---- -- Append JSON strings in the end of another JSON UPDATE promotion_banners SET items = items || '{"status": 1}'::jsonb WHERE id = 2;

  8. 20241016.1219
  9. Android Developers Blog: Quick introduction to Large Language Models for Android - [s]

  10. 20241002.1421
  11. postgres|postgresql > Administering a Patroni Managed PostgreSQL Cluster - [s]

  12. 20240926.1725
  13. postgres|postgresql > Determining the optimal value for shared_buffers using the pg_buffercache - [s]

    # Also see: https://www.postgresql.org/docs/current/pgbuffercache.html CREATE EXTENSION pg_buffercache; -- identify the top 10 relations residing in shared_buffers and percentage utilisation SELECT c.relname, pg_size_pretty(count(*)*8192) AS buffer_size, pg_size_pretty(pg_relation_size(c.oid)) as relation_size, Round(100.0 * Count(*) / (SELECT setting FROM pg_settings WHERE name = 'shared_buffers') :: INTEGER, 2) AS buffers_percent, ROUND(count(*)*8192*100/ pg_relation_size(c.oid)::numeric, 2 ) AS relation_percent, CASE WHEN c.relkind = 'r' THEN 'table' WHEN c.relkind = 'i' THEN 'index' WHEN c.relkind = 'S' THEN 'sequence' WHEN c.relkind = 't' THEN 'TOAST table' WHEN c.relkind = 'v' THEN 'view' WHEN c.relkind = 'm' THEN 'materialized view' WHEN c.relkind = 'c' THEN 'composite type' WHEN c.relkind = 'f' THEN 'foreign table' WHEN c.relkind = 'p' THEN 'partitioned table' WHEN c.relkind = 'I' THEN 'partitioned index' ELSE 'Unexpected relkind' END as relation_type FROM pg_class c INNER JOIN pg_buffercache b ON b.relfilenode = c.relfilenode INNER JOIN pg_database d ON ( b.reldatabase = d.oid AND d.datname = Current_database() ) GROUP BY c.relname, c.oid ORDER BY pg_total_relation_size(c.oid) DESC LIMIT 10;

  14. 20240923.0904
  15. Testing LDAP Connections With Java | Baeldung - [s]

[s] public (8)