{"uid":"cap_vhgEGyii9vL5qc13zBBZv","slug":"tenjin-article-pgvector-testcontainer-sort-order-schema-digest-fixes-d510ad68","name":"Tenjin Article: pgvector Testcontainer Sort Order & Schema Digest Fixes","description":"Swapping your Postgres testcontainer to pgvector silently changes sort order and breaks schema digests. You add semantic search to a production TypeScript monorepo, so your integration tests need CREATE EXTENSION vector. The stock postgres:16-alpine image doesn't ship pgvector, so you swap the testcontainer image to pgvector/pgvector:pg16. Tests that have nothing to do with vectors start failing. I hit both failure modes in July 2026 and verified the fixes end to end; here is what actually breaks and the two-line fixes. Both images report the same database collation, datcollate = en_US.utf8. But p","url":"https://tenjin.blog/api/read/0xe4c16d163d80fd972e6e1e9b94bc71c5fbe5a9c5/swapping-your-postgres-testcontainer-to-pgvector-silently-changes-sort-order-and?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"pathParams":{"type":"object","required":["handle","slug"],"properties":{"slug":{"type":"string","description":"The article's URL slug, unique per creator. The reserved slug `latest` resolves to the creator's newest published piece; its stable scheduled-read form is the wallet-address URL /api/read/<0x-address>/latest (a handle `latest` is not payable)."},"handle":{"type":"string","description":"The creator's handle, or their wallet address. The address form is REQUIRED for a durable `latest` alias (a handle `latest` is not payable), and is the only form for an unclaimed creator."}}},"queryParams":{"type":"object","required":[],"properties":{},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JHJWxjXSP6pc4XQmq_Qzm","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the full paid text of a Tenjin article explaining how swapping a Postgres testcontainer image to pgvector silently breaks sort order and schema digests, including the two-line fixes.","exampleAgentPrompt":"Can you fetch me the full Tenjin article about why swapping your Postgres testcontainer to pgvector silently breaks sort order and what the two-line fixes are? The creator handle is 0xe4c16d163d80fd972e6e1e9b94bc71c5fbe5a9c5 and the slug is swapping-your-postgres-testcontainer-to-pgvector-silently-changes-sort-order-and.","exampleUseCases":[{"title":"Debugging pgvector testcontainer regressions","prompt":"I'm seeing my integration tests fail after switching to the pgvector/pgvector:pg16 image — can you pull up the full Tenjin article by 0xe4c16d163d80fd972e6e1e9b94bc71c5fbe5a9c5 with the slug swapping-your-postgres-testcontainer-to-pgvector-silently-changes-sort-order-and so I can see what's actually breaking and how to fix it?"},{"title":"Adding semantic search to TypeScript monorepo","prompt":"I need to add pgvector to my TypeScript monorepo and make sure my existing postgres integration tests still pass — fetch me the paid Tenjin piece by creator 0xe4c16d163d80fd972e6e1e9b94bc71c5fbe5a9c5 on the slug swapping-your-postgres-testcontainer-to-pgvector-silently-changes-sort-order-and that covers the schema digest and sort order pitfalls."},{"title":"Understanding collation changes from pgvector image","prompt":"Why does swapping to pgvector change sort order even when both images report en_US.utf8 collation? Get the full article from Tenjin by 0xe4c16d163d80fd972e6e1e9b94bc71c5fbe5a9c5 at slug swapping-your-postgres-testcontainer-to-pgvector-silently-changes-sort-order-and to explain what's going on under the hood."}],"resultDescription":"The full article text returned as a JSON payload containing the complete written content of the piece, covering both failure modes when swapping Postgres testcontainer images to pgvector/pgvector:pg16 — specifically sort order regressions and schema digest breaks — along with verified two-line fixes, as published on the Tenjin pay-per-read platform.","failureModes":["Payment not made or x402 challenge not completed — returns 402 Payment Required with challenge details","Invalid or non-existent slug — returns 404 or error indicating article not found","Invalid creator handle or wallet address — returns 404 or resolution error","Article not yet published or behind embargo — content unavailable","Network timeout from Tenjin origin server"],"whenToPreferThis":"Use this endpoint when you specifically want to read the full text of this Tenjin article about pgvector testcontainer issues. It is a direct pay-per-read lookup for a single published piece identified by creator address and slug. Prefer this over Tenjin's synthesis/Q&A endpoint when you want the unaltered full article rather than an AI-synthesized answer, and over generic web search when you want authoritative, publisher-controlled content with a guaranteed payment flow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T06:42:25.756Z","isFirstParty":false,"canonicalSlug":"tenjin-article-pgvector-testcontainer-sort-order-schema-digest-fixes-d510ad68"}