Skip to content

Instantly share code, notes, and snippets.

View theory's full-sized avatar
💭
🥃

David E. Wheeler theory

💭
🥃
View GitHub Profile
@theory
theory / about.md
Last active July 16, 2024 13:41
JSON Entity Selection

Say you have a JSON entity like this:

{
  "meta": {
    "created_at": "2024-06-25T11:56:42Z",
    "updated_at": "2024-07-12T15:32:24Z",
    "created_by": "theory",
    "updated_by": "strongrrl"
  },
@theory
theory / docker-compose.yml
Last active June 20, 2024 19:49
POC: Create and install Postgres Trunk Binaries
version: "3.9"
name: trunking
# Start a Zot service for pushing and pulling OCI images, and a
# pgxn/pgxn-tools image for building and testing Linux/AMD binaries.
#
# docker compose up -d
# docker compose exec linux bash
# make clean && make && make trunk
#
@theory
theory / pgxnv2-architecture.md
Last active April 22, 2024 19:43
PGXN v2 Architecture

NOTE: Moved to the Postgres Wiki

PGXN v2 Architecture

Introduction

This document outlines the project to build extension distribution, discovery, and packaging tools and services to power the growth, accessability, and

@theory
theory / pgxn-dist-with-git-dir.txt
Created January 31, 2024 16:42
PGXN distributions that contain a .git directory
2011-08-22+17:22:16.0000000000 ./couchdb_fdw/couchdb_fdw-0.1.0/.git
2013-06-19+09:47:05.0000000000 ./jdbc_fdw/jdbc_fdw-1.0.0/.git
2013-06-19+09:47:12.0000000000 ./odbc_fdw/odbc_fdw-0.1.0/.git
2013-06-19+09:49:36.0000000000 ./www_fdw/www_fdw-0.1.6/.git
2017-05-24+22:15:01.8016781320 ./foreign-keycloak-wrapper/foreign-keycloak-wrapper-0.1.1/.git
2017-06-06+22:30:02.4726600060 ./foreign-keycloak-wrapper/foreign-keycloak-wrapper-1.0.0/.git
2017-06-06+23:45:02.3282102750 ./pg_feedback/pg_feedback-0.1.0/.git
2017-11-10+03:35:02.3228817480 ./pg_bulkload/pg_bulkload-3.1.14/.git
2018-05-16+23:40:02.2738588690 ./constraint_uniform/constraint_uniform-1.0.0/.git
2018-05-19+23:15:02.0967067030 ./constr_name_unif/constr_name_unif-1.0.0/.git
@theory
theory / extension-ecosystem-jobs-tools.md
Last active April 22, 2024 19:44
This document sketches an idealized Postgres extension ecosystem

NOTE: Moved to the Postgres Wiki

Extension Ecosystem: Jobs and Tools

This document sketches an idealized Postgres extension ecosystem.

Why?

The past year has seen a surge in interest in Postgres extension distribution. A number of people have noted in particular the challenges in finding and

Intensity of Importance Definition Explanation
1 Equal importance Two elements contribute equally to the objective
3 Moderate importance Experience and judgment moderately favor one element over another
5 Strong importance Experience and judgment strongly favor one element over another
7 Very strong importance One element is favored very strongly over another; its dominance is demonstrated in practice
9 Extreme importance The evidence favoring one element over another is of the highest possible order of affirmation
$ curl sfc-repo.snowflakecomputing.com -v
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 99.84.41.12...
* TCP_NODELAY set
* Connected to sfc-repo.snowflakecomputing.com (99.84.41.12) port 80 (#0)
> GET / HTTP/1.1
> Host: sfc-repo.snowflakecomputing.com
> User-Agent: curl/7.64.1
# # In docker container
# curl -v sfc-repo.snowflakecomputing.com/index.html
* Expire in 0 ms for 6 (transfer 0x5560e6f4ef50)
* Expire in 1 ms for 1 (transfer 0x5560e6f4ef50)
* Expire in 0 ms for 1 (transfer 0x5560e6f4ef50)
* Expire in 2 ms for 1 (transfer 0x5560e6f4ef50)
* Expire in 1 ms for 1 (transfer 0x5560e6f4ef50)
* Expire in 1 ms for 1 (transfer 0x5560e6f4ef50)
* Expire in 4 ms for 1 (transfer 0x5560e6f4ef50)
* Expire in 2 ms for 1 (transfer 0x5560e6f4ef50)
DO $$
DECLARE
target TEXT;
BEGIN
FOR target IN
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'bucardo'
AND table_name LIKE 'track_%'
LOOP
--- a/bucardo.schema
+++ b/bucardo.schema
@@ -73,8 +73,9 @@ RETURNS TRIGGER
LANGUAGE plpgsql
AS $bc$
BEGIN
-
- NEW.setting = LOWER(NEW.setting);
+ IF NEW.name <> ALL('{log_conflict_file,warning_file,email_debug_file,flatfile_dir,reason_file,stats_script_url,stopfile,log_timer_format}') THEN
+ NEW.setting = LOWER(NEW.setting);