SShortSingh.
Back to feed

Generic SQL formatters mishandle PostgreSQL-specific syntax, and the output shows it

0
·3 views

Pasting a Postgres query into a general-purpose online SQL formatter usually looks fine, but breaks on constructs like :: casts, JSON operators, and dollar-quoted function bodies. The author explains that these tools tokenise text rather than understand SQL, while PostgreSQL bends token rules more than other dialects. Pinning the formatter to the PostgreSQL dialect avoids this guessing, and identifier case must be preserved because unquoted names fold to lowercase. Tools like pgFormatter parse plpgsql properly and suit repository or CI use, while pgAdmin and psql offer little in the way of formatting. The author's browser-based, dialect-pinned formatter runs locally so queries containing real data are not transmitted, though it cannot verify schema or query plans.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

Memorilla Proposes Latent Semantic Memory to Help LLMs Retain Context

A new arXiv paper introduces Memorilla, a system that proposes latent semantic memory for large language models. The approach aims to give LLMs a way to store and retrieve information within their latent representations. The source material is limited to a link and a Hacker News discussion thread with few comments, so detailed technical results are not available here. Readers interested in the method's design and evaluation should consult the full paper directly.

0
ProgrammingHacker News ·

Size-It-Up: A Browser Game Surfaces on Hacker News

A new game titled Size-It-Up has been shared on Hacker News, linking to its page at magnitudle.com. The post received 6 points and no comments at the time it was captured. The source material provides only the title, link, and engagement figures, with no description of gameplay, developers, or release details. Further information about the game's mechanics or purpose is not available from the item itself.

0
ProgrammingHacker News ·

Perplexity Unveils AI Agents Designed for Complex, Ongoing Work

Perplexity has announced a new set of AI agents aimed at handling workplace tasks. The company describes them as teammates built for complex, ongoing work rather than one-off queries. The announcement was shared through a blog post on Perplexity's website. The source article provided limited detail beyond the headline and its title, so specifics on capabilities, pricing, and availability are not confirmed here. The story gained modest traction on Hacker News, where it drew a few points and a single comment.

0
ProgrammingDEV Community ·

Study finds many Lovable-built apps expose Supabase data on first page load

Researchers at Crissy Field examined 159,041 Lovable projects, of which 34,545 used Supabase. Of 24,664 sites examined more closely, many were already serving database records to visitors without any login. Further read-only requests with the public key surfaced email addresses in thousands of sites, along with more sensitive items such as passport details and chat messages. The authors caution that data appearing on first load is not automatically a confirmed leak, and the roughly 30% figure applies only to the sampled sites, not all Lovable apps. Security advisers stress that anon keys are meant to be public, so the real risk lies in missing or permissive row-level security rules.