Handling Time-Variant DAGs with Constraints in Postgres
Vehicle attachments in a fleet (trucks pulling trailers) are modeled as a time-variant DAG in a single Postgres table of edges with validity intervals and a source-authority priority.
Vehicle attachments in a fleet (trucks pulling trailers) are modeled as a time-variant DAG in a single Postgres table of edges with validity intervals and a source-authority priority.
A Kalman Filter can run entirely inside Postgres to smooth noisy GPS tracks, with per-device state (estimate plus covariance matrix) kept in a devices table and a kalman_step SQL function applying predict/update steps that can use HDOP or speed.
The ten most installed Postgres extensions across Neon's platform are plpgsql and pg_stat_statements (each in 1M+ databases), followed by uuid-ossp, pgvector, pgcrypto, pg_trgm, PostGIS, citext, unaccent and hstore.
pg_cron stores scheduled jobs as raw SQL text, separate from Postgres' system catalogs, so dropping a table leaves jobs that fail every run with "relation does not exist" and fill cron.job_run_details with errors.
A simple S3-like file server can be built inside Postgres by storing binary data in a BYTEA table and exposing it through PostgREST's functions-as-RPC via the Neon Data API.
Testing against SQLite when production runs Postgres gives false confidence.
Postgres and SQL Server share SQL but differ in dialect details that trip up migrating developers.
Postgres 17 is available on Neon for all plans, including Free, and can be provisioned in a few steps.
Postgres 17 adds RETURNING support to MERGE (with a merge_action() function that reports whether each row was inserted, updated or deleted), SQL/JSON functions including JSON_TABLE for turning JSON into relational rows, and performance work.
Even when writes are off the table, heavily indexing read-only Postgres tables only pays off under certain conditions: table size, query complexity, data cardinality and resource constraints.
Postgres's btree_gist extension lets a single GiST index combine one-dimensional B-Tree-style columns (like dates) with spatial PostGIS geometries, so queries filtering on both space and time can use one index scan.
Database round-trip latency compounds with every sequential query, so co-locating the backend with the database and cutting round trips matters more than raw query speed.
MySQL parses but silently ignores inline column-level `REFERENCES` clauses, so a foreign key written Postgres-style (`customer_id INT REFERENCES customers(customer_id) ON DELETE CASCADE`) creates no constraint, no index and no cascade behavior in MySQL.
Neon's serverless Postgres follows mostly standard Postgres tuning, plus a few Neon-specific checks.
Three starting points for diagnosing slow Postgres queries: use pg_stat_statements to find long-running queries by mean execution time and then EXPLAIN ANALYZE them, check the cache hit ratio (in Neon via the neon_stat_file_cache view, since Neon extends shared buffers with a local file cache), and look for table and index bloat caused by MVCC dead tuples.
Postgres 16 expands SQL/JSON syntax with JSON_ARRAY(), JSON_ARRAYAGG() and the IS JSON predicate, each shown with runnable examples.
Drizzle, Kysely, Prisma and Zapatos are compared as type-safe Postgres libraries for TypeScript across schema definition, query syntax, raw SQL support, migrations, edge-runtime support and community size.
SQL template tags like Neon's `sql` function look like string interpolation but are safe from SQL injection because they are JavaScript tagged template functions.
pg_tiktoken is a Postgres extension on Neon that wraps OpenAI's tiktoken BPE tokenizer, exposing tiktoken_encode (returns token IDs) and tiktoken_count (returns token counts) for encodings such as cl100k_base, p50k_base, p50k_edit and r50k_base or their model names.
Neon now supports PostgreSQL 15, and three of its features can be tried from Neon's SQL Editor with runnable examples.