MCPcopy Create free account
hub / github.com/PostHog/duckgres / isDropTableOnViewError

Function isDropTableOnViewError

server/conn_errors.go:331–339  ·  view source on GitHub ↗

isDropTableOnViewError checks if the error indicates that a DROP TABLE was attempted on a view. DuckDB returns: "Catalog Error: Existing object X is of type View, trying to drop type Table"

(err error)

Source from the content-addressed store, hash-verified

329// failure is user-attributable (Info-level "Query execution failed.")
330// or a real system error worth alerting on (Error-level "Query
331// execution errored."). The discriminator is the SQLSTATE class —
332// already computed via classifyErrorCode for the pgwire response.
333//
334// Cancellations (SQLSTATE 57014) are NOT short-circuited as user errors
335// here. The call sites (logQueryError, the clientConn error paths) gate
336// caller-driven cancellations upstream via clientConn.isCallerCancellation,
337// so by the time isUserQueryError sees a cancel-shaped err the cancellation
338// was infra-driven (gRPC client closed because the worker died, the worker
339// was retired, etc.) and class 57 = operator intervention is the right
340// bucket — that's a real failure we want surfaced at Error level.
341func isUserQueryError(err error) bool {
342 if err == nil {

Callers 2

Calls 1

ErrorMethod · 0.45

Tested by 1