| BML-S | Help Login

Last entries

    20250804.1053
  1. postgres|postgresql > WITH Queries (CTE recursive) for lineage/tree - [s]

    WITH RECURSIVE included_parts(sub_part, part, quantity) AS ( SELECT sub_part, part, quantity FROM parts WHERE part = 'our_product' UNION ALL SELECT p.sub_part, p.part, p.quantity * pr.quantity FROM included_parts pr, parts p WHERE p.part = pr.sub_part ) SELECT sub_part, SUM(quantity) as total_quantity FROM included_parts GROUP BY sub_part

  2. 20250717.1350
  3. postgres|postgresql > add sequence-like column in an existing (tmp) table with "BIGSERIAL" - [s]

    ALTER TABLE tmp_orphaned_metadata_checklist ADD COLUMN id BIGSERIAL PRIMARY KEY;

  4. 20250717.1345
  5. postgres - How do I decompose ctid into page and row numbers - [s]

    nxrm108015=> select ctid, (ctid::text::point)[0]::bigint as ctid1, (ctid::text::point)[1]::bigint as ctid2 from tmp_orphaned_metadata_checklist limit 10; ctid | ctid1 | ctid2 --------+-------+------- (0,1) | 0 | 1 (0,2) | 0 | 2 (0,3) | 0 | 3 (0,4) | 0 | 4 (0,5) | 0 | 5 (0,6) | 0 | 6 (0,7) | 0 | 7 (0,8) | 0 | 8 (0,9) | 0 | 9 (0,10) | 0 | 10 (10 rows) (ctid::text::point)[0]::bigint * 100000000 + (ctid::text::point)[1]::bigint as id

  6. 20250717.0822
  7. Getting Started with Apple’s container CLI on macOS: A Native Alternative to Docker - [s]

    brew install --cask container

[s] public (4)