Skip to content

Instantly share code, notes, and snippets.

@fastcat
fastcat / bug.sql
Created October 13, 2023 14:27
PG bug 18156
create table x (
p int4 not null,
i int4 not null,
f int4 null,
primary key (p, i),
foreign key (p, f) references x (p, i)
)
partition by list (p);
create table x1 partition of x for values in (0);
@fastcat
fastcat / lcd.sh
Last active February 27, 2024 05:06
Shell script to make it easy to control an Adafruit USB+Serial backpack (http://www.adafruit.com/products/784) from other shell scripts
#!/bin/bash
dev=/dev/serial/by-id/usb-239a_Adafruit_Industries-if00
# prefix byte for all commands
pfx='\xfe'
# named commands, associative array, start as just the hex chars
declare -A cmd=(
[on]=42\\xff # macro for below
[on2]=42 # +1 # arg ignored
[off]=46