Thinking about solving the Advent of Code in Postgres? I did it last year and I have summary of how to get started and some tips and tricks for writing your own solutions.
Greg has more solutions to the last Advent of Code, this is day 23. Here he takes an ASCII map of dots and hashes and looks for free spaces with cardinal directions. Some fun SQL in here with table rebuilds and ANSI color charts all inside plain PostgreSQL.
Greg has more solutions to the last Advent of Code. He takes the text input file and solves the puzzle by charting a route through a maze. With some cool settings, these animations run inside psql.
More Advent of Code solutions in PostgreSQL, this is day 21. Greg separates out the monkey speak and creates looped functions to predict what they're saying. For bonus points, Greg shows off the new friendly big number inputs in Postgres 16 that use a format like BIGINT = 1_000_000_000.
Greg continues to amaze us with solutions to the 2022 Advent of Code, this is day 20. Using only PostgreSQL he decrypts data, gets it sequenced, and gets back on his journey to meet up with the Elves.
The newest version of PgBouncer lets you run prepared statements while using a connection pooler. Greg breaks down the performance gains of prepared statements, why they have traditionally been a challenge, and this new feature.
Greg continues with Advent of Code series in Postgres with puzzle 19. This one uses recursive functions to follow blueprints and return the results. These functions even have terminal animations to show results as they are processed!
Greg continues with more puzzles and solutions for the Advent of Code series, today covering day 18's puzzle. Greg has some amazing functions for surface area, heat maps, and 3d visualizations.
Greg continues with Advent of Code series, this one is puzzle 17. This one works with falling rocks. Using sequences, arrays, and aggregates he makes a stackable objects with nothing but SQL!
When was this table created? Greg dives into the 5 places where you can get information about Postgres object creation.
Greg is still working on some of the puzzles in the Advent of Code series. In this one he tackles some routes, shortest paths, and cost. These are great sample PostgreSQL functions withs some bonus tips on using pg_stat_user_functions to look at recursion.
Day 15 of AOC we have new hands on SQL for the Beacon Exclusion Zone. This one uses CTEs, sequences, regexp_substr() / regexp_match(), int4range, range_agg(), and an upsert.
Day 14 of AOC we have new hands on SQL for the Distress Signal. This one uses lag(), sequencing, regexp_replace(), and overlay().
Day 13 of AOC we have new hands on SQL for the Distress Signal. This one uses lag(), sequencing, regexp_replace(), and overlay().
Day 12 of AOC we have new hands on SQL for the Hill Climbing Algorithm. This one uses parsing, an IDENTITY column, functions, and text arrays.
Day 11 of AOC we have new hands on SQL for playing Monkey in the Middle. This one uses sequences, string functions, and window functions.
Day 10 of AOC we have new hands on SQL for reading signals. This one uses sequences and the OVER() function.
Day 9 of AOC we have new hands on SQL for looking at a rope bridge. This one uses a custom function and colored ASCII art.