Created
May 25, 2026 15:39
-
-
Save polRk/abdd4cfdb9c37fe552a7aa37aa4e4f90 to your computer and use it in GitHub Desktop.
ydb_fdw empirical readiness harness — schemas of 15 OSS projects fed through the FDW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Aggregate per-project FDW error tsv files into a cross-project picture.""" | |
| import re | |
| from collections import Counter, defaultdict | |
| from pathlib import Path | |
| results = Path("/workdir/empirical/results") | |
| projects = sorted(d.name for d in results.iterdir() if d.is_dir() and (d / "errors.tsv").exists()) | |
| totals = {} | |
| per_proj_cat = defaultdict(lambda: defaultdict(int)) | |
| type_unknown_types = Counter() | |
| ext_missing = Counter() | |
| pg_funcs_missing = Counter() | |
| for p in projects: | |
| errors_tsv = results / p / "errors.tsv" | |
| with errors_tsv.open() as f: | |
| next(f, None) | |
| for line in f: | |
| parts = line.rstrip("\n").split("\t") | |
| if len(parts) < 4: | |
| continue | |
| _file, cat, err, sql = parts[0], parts[1], parts[2], parts[3] | |
| per_proj_cat[p][cat] += 1 | |
| if cat.startswith("TYPE_UNKNOWN"): | |
| m = re.search(r"Unsupported type ([^\s]+(?:\[\])?)", err) | |
| if m: | |
| type_unknown_types[m.group(1)] += 1 | |
| m = re.search(r'type "([^"]+)"', err) | |
| if m: | |
| type_unknown_types[m.group(1)] += 1 | |
| if "extension" in err and "is not available" in err: | |
| m = re.search(r'extension "([^"]+)"', err) | |
| if m: | |
| ext_missing[m.group(1)] += 1 | |
| if "function" in err and "does not exist" in err: | |
| m = re.search(r"function ([^\s(]+)", err) | |
| if m: | |
| pg_funcs_missing[m.group(1)] += 1 | |
| totals[p] = sum(per_proj_cat[p].values()) | |
| P_LABEL = "project" | |
| E_LABEL = "errors" | |
| print("# CROSS-PROJECT ERROR COUNTS\n") | |
| print(f"{P_LABEL:<14}{E_LABEL:>8} top categories") | |
| for p in sorted(projects, key=lambda x: -totals[x]): | |
| top = sorted(per_proj_cat[p].items(), key=lambda kv: -kv[1])[:4] | |
| cat_str = ", ".join(f"{c}={n}" for c, n in top) | |
| print(f"{p:<14}{totals[p]:>8} {cat_str}") | |
| print("\n# CATEGORY FREQUENCY ACROSS ALL PROJECTS\n") | |
| all_cats = Counter() | |
| for p in projects: | |
| for c, n in per_proj_cat[p].items(): | |
| all_cats[c] += n | |
| for c, n in all_cats.most_common(25): | |
| projects_with = sum(1 for p in projects if per_proj_cat[p].get(c, 0) > 0) | |
| print(f" {n:>6} ({projects_with:>2}/{len(projects)} projects) {c}") | |
| print("\n# UNSUPPORTED TYPES (most common)\n") | |
| for t, n in type_unknown_types.most_common(25): | |
| print(f" {n:>5} {t}") | |
| print("\n# MISSING EXTENSIONS\n") | |
| for e, n in ext_missing.most_common(): | |
| print(f" {n:>5} {e}") | |
| print("\n# MISSING PG FUNCTIONS\n") | |
| for fn, n in pg_funcs_missing.most_common(15): | |
| print(f" {n:>5} {fn}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # CROSS-PROJECT ERROR COUNTS | |
| project errors top categories | |
| calcom 1268 OTHER=622, TYPE_UNKNOWN=178, NO_FOREIGN_KEY=138, NO_ADD_CONSTRAINT=120 | |
| discourse 1236 OTHER=698, NO_ADD_CONSTRAINT=301, TYPE_UNKNOWN=71, ALTER_COL_NOT_REDIRECTED=64 | |
| lemmy 914 OTHER=819, ALTER_COL_NOT_REDIRECTED=78, NO_ADD_CONSTRAINT=12, NO_EXTENSION=2 | |
| hydra 639 OTHER=423, ALTER_COL_NOT_REDIRECTED=125, NO_ADD_CONSTRAINT=82, NO_EXTENSION=4 | |
| drone 442 OTHER=279, ALTER_COL_NOT_REDIRECTED=102, NO_ADD_CONSTRAINT=15, NO_PARTIAL_INDEX=14 | |
| mattermost 430 OTHER=193, ALTER_COL_NOT_REDIRECTED=146, OBJECT_EXISTS=53, INDEX_TYPE_NOT_SUPPORTED:GIN=11 | |
| concourse 285 OTHER=156, NO_ADD_CONSTRAINT=57, NO_FOREIGN_KEY=37, ALTER_COL_NOT_REDIRECTED=23 | |
| plausible 187 NO_ADD_CONSTRAINT=54, OTHER=49, NO_FOREIGN_KEY=27, SYNTAX_ERROR=17 | |
| authelia 155 OTHER=93, TYPE_UNKNOWN=28, NO_ADD_CONSTRAINT=21, ALTER_COL_NOT_REDIRECTED=7 | |
| woodpecker 84 OTHER=56, NO_ADD_CONSTRAINT=17, TYPE_UNKNOWN=6, ALTER_COL_NOT_REDIRECTED=5 | |
| miniflux 74 SYNTAX_ERROR=66, OTHER=7, TYPE_UNKNOWN=1 | |
| zitadel 48 OTHER=36, ALTER_COL_NOT_REDIRECTED=5, NO_PARTIAL_INDEX=4, NO_ON_CONFLICT=2 | |
| listmonk 38 OTHER=33, TYPE_UNKNOWN=4, NO_EXTENSION=1 | |
| gitlabhq 12 TYPE_UNKNOWN=3, NO_EXTENSION=2, TYPE_UNKNOWN:namespaces=2, TYPE_UNKNOWN:projects=2 | |
| probe 7 NO_SAVEPOINTS=5, NO_ON_CONFLICT=2 | |
| pagila 4 TYPE_UNKNOWN=1, OTHER=1, TYPE_UNKNOWN:public.customer=1, NO_PG_FUNCTION=1 | |
| probe2 2 OTHER=2 | |
| mastodon 0 | |
| minimal 0 | |
| # CATEGORY FREQUENCY ACROSS ALL PROJECTS | |
| 3468 (16/19 projects) OTHER | |
| 684 (11/19 projects) NO_ADD_CONSTRAINT | |
| 677 (11/19 projects) ALTER_COL_NOT_REDIRECTED | |
| 327 (13/19 projects) TYPE_UNKNOWN | |
| 243 ( 8/19 projects) NO_FOREIGN_KEY | |
| 88 ( 5/19 projects) NO_PARTIAL_INDEX | |
| 84 ( 3/19 projects) SYNTAX_ERROR | |
| 63 ( 6/19 projects) NO_ON_CONFLICT | |
| 54 ( 2/19 projects) OBJECT_EXISTS | |
| 24 ( 7/19 projects) NO_EXTENSION | |
| 21 ( 4/19 projects) INDEX_TYPE_NOT_SUPPORTED:GIN | |
| 12 ( 1/19 projects) NO_ENUM_TYPE | |
| 12 ( 3/19 projects) NO_RULES | |
| 9 ( 3/19 projects) NO_PG_FUNCTION | |
| 5 ( 1/19 projects) NO_SAVEPOINTS | |
| 4 ( 1/19 projects) NO_IDENTITY | |
| 3 ( 1/19 projects) TYPE_UNKNOWN:public.halfvec | |
| 3 ( 1/19 projects) TYPE_UNKNOWN:public.citext[] | |
| 2 ( 1/19 projects) TYPE_UNKNOWN:WatchlistType | |
| 2 ( 1/19 projects) TYPE_UNKNOWN:BookingStatus | |
| 2 ( 1/19 projects) TYPE_UNKNOWN:namespaces | |
| 2 ( 1/19 projects) TYPE_UNKNOWN:projects | |
| 2 ( 1/19 projects) TYPE_UNKNOWN:users | |
| 2 ( 1/19 projects) TYPE_UNKNOWN:public.citext | |
| 1 ( 1/19 projects) TYPE_UNKNOWN:MembershipRole | |
| # UNSUPPORTED TYPES (most common) | |
| 46 jsonb | |
| 32 timestamp | |
| 20 date | |
| 17 json | |
| 12 inet | |
| 7 character | |
| 6 tsvector | |
| 5 text[] | |
| 4 integer[] | |
| 3 public.halfvec | |
| 3 public.citext[] | |
| 2 "WatchlistType" | |
| 2 WatchlistType | |
| 2 "BookingStatus" | |
| 2 BookingStatus | |
| 2 namespaces | |
| 2 projects | |
| 2 users | |
| 2 public.citext | |
| 1 "MembershipRole" | |
| 1 MembershipRole | |
| 1 "ReminderType" | |
| 1 ReminderType | |
| 1 "PaymentType" | |
| 1 PaymentType | |
| # MISSING EXTENSIONS | |
| 10 uuid-ossp | |
| 3 pg_trgm | |
| 2 citext | |
| 2 pgcrypto | |
| 1 hstore | |
| 1 unaccent | |
| 1 vector | |
| 1 btree_gin | |
| 1 btree_gist | |
| 1 ltree | |
| # MISSING PG FUNCTIONS | |
| 8 uuid_generate_v4 | |
| 1 public.rewards_report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| === authelia === | |
| Total ERROR lines: 155 | |
| Unique categories: 6 | |
| 93 OTHER | |
| e.g. ERROR: relation "authentication_logs" does not exist | |
| SQL: CREATE INDEX authentication_logs_username_idx ON authentication_logs (time, username, auth_type); | |
| e.g. ERROR: relation "authentication_logs" does not exist | |
| SQL: CREATE INDEX authentication_logs_remote_ip_idx ON authentication_logs (time, remote_ip, auth_type); | |
| 28 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type timestamp with time zone for column 'time' in table public.authentication_logs | |
| SQL: CREATE TABLE IF NOT EXISTS authentication_logs ( id SERIAL CONSTRAINT authentication_logs_pkey PRIMARY KEY, time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, successful BOO | |
| e.g. ERROR: Unsupported type timestamp with time zone for column 'iat' in table public.identity_verification | |
| SQL: CREATE TABLE IF NOT EXISTS identity_verification ( id SERIAL CONSTRAINT identity_verification_pkey PRIMARY KEY, jti CHAR(36), iat TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAM | |
| 21 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "oauth2_consent_session" does not exist | |
| SQL: ALTER TABLE oauth2_consent_session ADD CONSTRAINT oauth2_consent_subject_fkey FOREIGN KEY (subject) REFERENCES user_opaque_identifier (identifier) ON UPDATE RESTRICT ON DELETE | |
| e.g. ERROR: relation "oauth2_authorization_code_session" does not exist | |
| SQL: ALTER TABLE oauth2_authorization_code_session ADD CONSTRAINT oauth2_authorization_code_session_challenge_id_fkey FOREIGN KEY (challenge_id) REFERENCES oauth2_consent_session (c | |
| 7 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "oauth2_access_token_session" does not exist | |
| SQL: ALTER TABLE oauth2_access_token_session ALTER COLUMN challenge_id DROP NOT NULL, ALTER COLUMN challenge_id SET DEFAULT NULL, ALTER COLUMN subject DROP NOT NULL, ALTER COLUMN subject SET DEFAULT NULL; | |
| e.g. ERROR: relation "oauth2_access_token_session" does not exist | |
| SQL: ALTER TABLE oauth2_access_token_session ALTER COLUMN signature TYPE VARCHAR(768); | |
| 4 NO_IDENTITY | |
| e.g. ERROR: relation "identity_verification" does not exist | |
| SQL: CREATE UNIQUE INDEX identity_verification_jti_key ON identity_verification (jti); | |
| e.g. ERROR: relation "identity_verification" does not exist | |
| SQL: DROP CONSTRAINT IF EXISTS identity_verification_jti_key; | |
| 2 NO_FOREIGN_KEY | |
| e.g. ERROR: cannot create index on relation "user_preferences" | |
| SQL: CREATE UNIQUE INDEX user_preferences_username_key ON user_preferences (username); | |
| e.g. ERROR: cannot create index on relation "user_preferences" | |
| SQL: CREATE UNIQUE INDEX user_preferences_username_key ON user_preferences (username); | |
| ---------------------------------------- | |
| === calcom === | |
| Total ERROR lines: 1268 | |
| Unique categories: 40 | |
| 622 OTHER | |
| e.g. ERROR: cannot create index on relation "users" | |
| SQL: CREATE UNIQUE INDEX "users.email_unique" ON "users"("email"); | |
| e.g. ERROR: relation "Credential" does not exist | |
| SQL: ALTER TABLE "Credential" ADD FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE; | |
| 178 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type jsonb for column 'locations' in table public.EventType | |
| SQL: CREATE TABLE "EventType" ( "id" SERIAL NOT NULL, "title" TEXT NOT NULL, "slug" TEXT NOT NULL, "description" TEXT, "locations" JSONB, "length" INTEGER NOT NULL, "hidden" BOO | |
| e.g. ERROR: Unsupported type jsonb for column 'key' in table public.Credential | |
| SQL: CREATE TABLE "Credential" ( "id" SERIAL NOT NULL, "type" TEXT NOT NULL, "key" JSONB NOT NULL, "userId" INTEGER, PRIMARY KEY ("id") ); psql:projects/cal.com/packages/prisma/migratio | |
| 138 NO_FOREIGN_KEY | |
| e.g. ERROR: foreign key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE "Attendee" ADD FOREIGN KEY ("bookingId") REFERENCES "Booking"("id") ON DELETE SET NULL ON UPDATE CASCADE; | |
| e.g. ERROR: foreign key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE "Booking" ADD FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE; | |
| 120 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "Membership" does not exist | |
| SQL: ALTER TABLE "Membership" ADD CONSTRAINT "Membership_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | |
| e.g. ERROR: relation "Membership" does not exist | |
| SQL: ALTER TABLE "Membership" ADD CONSTRAINT "Membership_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | |
| 108 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "Availability" does not exist | |
| SQL: ALTER TABLE "Availability" ADD COLUMN "startTime" TIME; | |
| e.g. ERROR: relation "Availability" does not exist | |
| SQL: ALTER TABLE "Availability" ADD COLUMN "endTime" TIME; | |
| 53 NO_ON_CONFLICT | |
| e.g. ERROR: relation "App" does not exist | |
| SQL: insert into "App" ("slug", "dirName", "updatedAt", "categories") values ('daily-video', 'dailyvideo', CURRENT_TIMESTAMP, '{video}') on conflict do nothing | |
| e.g. ERROR: relation "Feature" does not exist | |
| SQL: ), ( 'teams', true, 'Enable teams for this instance', 'OPERATIONAL' ), ( 'webhooks', true, 'Enable webhooks for this instance', 'OPERATIONAL' ) ON CONFLICT (s | |
| 12 NO_ENUM_TYPE | |
| e.g. ERROR: relation "CalAiPhoneNumber" does not exist | |
| SQL: CREATE UNIQUE INDEX "CalAiPhoneNumber_phoneNumber_key" ON "CalAiPhoneNumber"("phoneNumber"); | |
| e.g. ERROR: relation "CalAiPhoneNumber" does not exist | |
| SQL: CREATE UNIQUE INDEX "CalAiPhoneNumber_providerPhoneNumberId_key" ON "CalAiPhoneNumber"("providerPhoneNumberId"); | |
| 2 TYPE_UNKNOWN:WatchlistType | |
| e.g. ERROR: Unsupported type "WatchlistType" for column 'type' in table public.Watchlist | |
| SQL: CREATE TABLE "Watchlist" ( "id" TEXT NOT NULL, "type" "WatchlistType" NOT NULL, "value" TEXT NOT NULL, "description" TEXT, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTA | |
| e.g. ERROR: Unsupported type "WatchlistType" for column 'type' in table public.WatchlistAudit | |
| SQL: CREATE TABLE "WatchlistAudit" ( "id" UUID NOT NULL, "type" "WatchlistType" NOT NULL, "value" TEXT NOT NULL, "description" TEXT, "action" "WatchlistAction" NOT NULL DEFAULT 'REPORT' | |
| 2 TYPE_UNKNOWN:BookingStatus | |
| e.g. ERROR: Unsupported type "BookingStatus" for column 'bookingStatus' in table public.RoutingFormResponseDenormalized | |
| SQL: "bookingAssignmentReason" TEXT, "eventTypeId" INTEGER, "eventTypeParentId" INTEGER, "eventTypeSchedulingType" TEXT, "createdAt" TIMESTAMP(3) NOT NULL, "utm_source" TEXT, "u | |
| e.g. ERROR: Unsupported type "BookingStatus" for column 'status' in table public.BookingDenormalized | |
| SQL: "teamId" INTEGER, "eventLength" INTEGER, "eventParentId" INTEGER, "userEmail" TEXT, "userName" TEXT, "userUsername" TEXT, "ratingFeedback" TEXT, "rating" INTEGER, " | |
| 2 NO_PARTIAL_INDEX | |
| e.g. ERROR: cannot create index on relation "Booking" | |
| SQL: CREATE INDEX "Booking_reassignById_idx" ON "Booking"("reassignById") WHERE "reassignById" IS NOT NULL; | |
| e.g. ERROR: relation "CreditExpenseLog" does not exist | |
| SQL: CREATE INDEX "CreditExpenseLog_bookingUid_idx" ON "CreditExpenseLog"("bookingUid") WHERE "bookingUid" IS NOT NULL; | |
| 2 NO_RULES | |
| e.g. ERROR: relation "public.AttributeSyncRule" does not exist | |
| SQL: CREATE UNIQUE INDEX "AttributeSyncRule_integrationAttributeSyncId_key" ON "public"."AttributeSyncRule"("integrationAttributeSyncId"); | |
| e.g. ERROR: relation "public.AttributeSyncRule" does not exist | |
| SQL: ALTER TABLE "public"."AttributeSyncRule" ADD CONSTRAINT "AttributeSyncRule_integrationAttributeSyncId_fkey" FOREIGN KEY ("integrationAttributeSyncId") REFERENCES "public"."IntegrationAttributeSync"("i | |
| 1 TYPE_UNKNOWN:MembershipRole | |
| e.g. ERROR: Unsupported type "MembershipRole" for column 'role' in table public.Membership | |
| SQL: CREATE TABLE "Membership" ( "teamId" INTEGER NOT NULL, "userId" INTEGER NOT NULL, "accepted" BOOLEAN NOT NULL DEFAULT false, "role" "MembershipRole" NOT NULL, PRIMARY KEY ("userId" | |
| 1 TYPE_UNKNOWN:ReminderType | |
| e.g. ERROR: Unsupported type "ReminderType" for column 'reminderType' in table public.ReminderMail | |
| SQL: CREATE TABLE "ReminderMail" ( "id" SERIAL NOT NULL, "referenceId" INTEGER NOT NULL, "reminderType" "ReminderType" NOT NULL, "elapsedMinutes" INTEGER NOT NULL, "createdAt" TIMESTAMP | |
| 1 TYPE_UNKNOWN:PaymentType | |
| e.g. ERROR: Unsupported type "PaymentType" for column 'type' in table public.Payment | |
| SQL: "uid" TEXT NOT NULL, "type" "PaymentType" NOT NULL, "bookingId" INTEGER NOT NULL, "amount" INTEGER NOT NULL, "fee" INTEGER NOT NULL, "currency" TEXT NOT NULL, "success" BOO | |
| 1 TYPE_UNKNOWN:WebhookTriggerEvents | |
| e.g. ERROR: Unsupported type "WebhookTriggerEvents"[] for column 'eventTriggers' in table public.Webhook | |
| SQL: CREATE TABLE "Webhook" ( "id" TEXT NOT NULL, "userId" INTEGER NOT NULL, "subscriberUrl" TEXT NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "active" BOOLEAN | |
| 1 TYPE_UNKNOWN:WorkflowActions | |
| e.g. ERROR: Unsupported type "WorkflowActions" for column 'action' in table public.WorkflowStep | |
| SQL: CREATE TABLE "WorkflowStep" ( "id" SERIAL NOT NULL, "stepNumber" INTEGER NOT NULL, "action" "WorkflowActions" NOT NULL, "workflowId" INTEGER NOT NULL, "sendTo" TEXT, "reminderB | |
| 1 TYPE_UNKNOWN:WorkflowTriggerEvents | |
| e.g. ERROR: Unsupported type "WorkflowTriggerEvents" for column 'trigger' in table public.Workflow | |
| SQL: CREATE TABLE "Workflow" ( "id" SERIAL NOT NULL, "name" TEXT NOT NULL, "userId" INTEGER NOT NULL, "trigger" "WorkflowTriggerEvents" NOT NULL, "time" INTEGER, "timeUnit" "TimeUni | |
| 1 TYPE_UNKNOWN:WorkflowMethods | |
| e.g. ERROR: Unsupported type "WorkflowMethods" for column 'method' in table public.WorkflowReminder | |
| SQL: CREATE TABLE "WorkflowReminder" ( "id" SERIAL NOT NULL, "bookingUid" TEXT NOT NULL, "method" "WorkflowMethods" NOT NULL, "scheduledDate" TIMESTAMP(3) NOT NULL, "referenceId" TEXT, | |
| 1 TYPE_UNKNOWN:FeatureType | |
| e.g. ERROR: Unsupported type "FeatureType" for column 'type' in table public.Feature | |
| SQL: CREATE TABLE "Feature" ( "slug" TEXT NOT NULL, "enabled" BOOLEAN NOT NULL DEFAULT false, "description" TEXT, "type" "FeatureType" DEFAULT 'RELEASE', "stale" BOOLEAN DEFAULT false, | |
| 1 TYPE_UNKNOWN:RedirectType | |
| e.g. ERROR: Unsupported type "RedirectType" for column 'type' in table public.TempOrgRedirect | |
| SQL: CREATE TABLE "TempOrgRedirect" ( "id" SERIAL NOT NULL, "from" TEXT NOT NULL, "fromOrgId" INTEGER NOT NULL, "type" "RedirectType" NOT NULL, "toUrl" TEXT NOT NULL, "enabled" BOOL | |
| 1 TYPE_UNKNOWN:AttributeType | |
| e.g. ERROR: Unsupported type "AttributeType" for column 'type' in table public.Attribute | |
| SQL: CREATE TABLE "Attribute" ( "id" TEXT NOT NULL, "teamId" INTEGER NOT NULL, "type" "AttributeType" NOT NULL, "name" TEXT NOT NULL, "slug" TEXT NOT NULL, "enabled" BOOLEAN NOT NUL | |
| 1 TYPE_UNKNOWN:EventTypeAutoTranslatedField | |
| e.g. ERROR: Unsupported type "EventTypeAutoTranslatedField" for column 'field' in table public.EventTypeTranslation | |
| SQL: "id" TEXT NOT NULL, "eventTypeId" INTEGER NOT NULL, "field" "EventTypeAutoTranslatedField" NOT NULL, "sourceLang" TEXT NOT NULL, "targetLang" TEXT NOT NULL, "translatedText" TE | |
| 1 TYPE_UNKNOWN:AssignmentReasonEnum | |
| e.g. ERROR: Unsupported type "AssignmentReasonEnum" for column 'reasonEnum' in table public.AssignmentReason | |
| SQL: CREATE TABLE "AssignmentReason" ( "id" SERIAL NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "bookingId" INTEGER NOT NULL, "reasonEnum" "AssignmentReasonEnum" N | |
| 1 TYPE_UNKNOWN:IncompleteBookingActionType | |
| e.g. ERROR: Unsupported type "IncompleteBookingActionType" for column 'actionType' in table public.App_RoutingForms_IncompleteBookingActions | |
| SQL: CREATE TABLE "App_RoutingForms_IncompleteBookingActions" ( "id" SERIAL NOT NULL, "formId" TEXT NOT NULL, "actionType" "IncompleteBookingActionType" NOT NULL, "data" JSONB NOT NULL, | |
| 1 TYPE_UNKNOWN:BillingPeriod | |
| e.g. ERROR: Unsupported type "BillingPeriod" for column 'billingPeriod' in table public.OrganizationOnboarding | |
| SQL: "slug" TEXT NOT NULL, "logo" TEXT, "bio" TEXT, "isDomainConfigured" BOOLEAN NOT NULL DEFAULT false, "stripeCustomerId" TEXT, "stripeSubscriptionId" TEXT, "stripeSubscriptio | |
| 1 TYPE_UNKNOWN:FilterSegmentScope | |
| e.g. ERROR: Unsupported type "FilterSegmentScope" for column 'scope' in table public.FilterSegment | |
| SQL: "scope" "FilterSegmentScope" NOT NULL, "activeFilters" JSONB, "sorting" JSONB, "columnVisibility" JSONB, "columnSizing" JSONB, "perPage" INTEGER NOT NULL, "createdAt" TIMES | |
| 1 TYPE_UNKNOWN:WorkflowContactType | |
| e.g. ERROR: Unsupported type "WorkflowContactType" for column 'type' in table public.WorkflowOptOutContact | |
| SQL: CREATE TABLE "WorkflowOptOutContact" ( "id" SERIAL NOT NULL, "type" "WorkflowContactType" NOT NULL, "value" TEXT NOT NULL, "optedOut" BOOLEAN NOT NULL, "createdAt" TIMESTAMP(3) NOT | |
| 1 INDEX_TYPE_NOT_SUPPORTED:GIN | |
| e.g. ERROR: relation "RoutingFormResponseField" does not exist | |
| SQL: CREATE INDEX "RoutingFormResponseField_valueStringArray_idx" ON "RoutingFormResponseField" USING GIN ("valueStringArray"); | |
| 1 TYPE_UNKNOWN:CreditType | |
| e.g. ERROR: Unsupported type "CreditType" for column 'creditType' in table public.CreditExpenseLog | |
| SQL: CREATE TABLE "CreditExpenseLog" ( "id" TEXT NOT NULL, "creditBalanceId" TEXT NOT NULL, "bookingUid" TEXT, "credits" INTEGER, "creditType" "CreditType" NOT NULL, "date" TIMESTAM | |
| 1 TYPE_UNKNOWN:RoleType | |
| e.g. ERROR: Unsupported type "RoleType" for column 'type' in table public.Role | |
| SQL: CREATE TABLE "Role" ( "id" TEXT NOT NULL, "name" TEXT NOT NULL, "description" TEXT, "teamId" INTEGER, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" T | |
| 1 TYPE_UNKNOWN:PhoneNumberSubscriptionStatus | |
| e.g. ERROR: Unsupported type "PhoneNumberSubscriptionStatus" for column 'subscriptionStatus' in table public.CalAiPhoneNumber | |
| SQL: "phoneNumber" TEXT NOT NULL, "provider" TEXT NOT NULL, "providerPhoneNumberId" TEXT, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL, | |
| 1 TYPE_UNKNOWN:WatchlistAction | |
| e.g. ERROR: Unsupported type "WatchlistAction" for column 'actionTaken' in table public.WatchlistEventAudit | |
| SQL: CREATE TABLE "WatchlistEventAudit" ( "id" UUID NOT NULL, "watchlistId" UUID NOT NULL, "eventTypeId" INTEGER NOT NULL, "actionTaken" "WatchlistAction" NOT NULL, "timestamp" TIMESTAM | |
| 1 TYPE_UNKNOWN:BookingReportReason | |
| e.g. ERROR: Unsupported type "BookingReportReason" for column 'reason' in table public.BookingReport | |
| SQL: "bookingUid" TEXT NOT NULL, "bookerEmail" TEXT NOT NULL, "reportedById" INTEGER, "organizationId" INTEGER, "reason" "BookingReportReason" NOT NULL, "description" TEXT, "can | |
| 1 NO_TRIGGERS | |
| e.g. ERROR: cannot create index on relation "WebhookScheduledTriggers" | |
| SQL: CREATE INDEX "WebhookScheduledTriggers_bookingId_idx" ON "WebhookScheduledTriggers"("bookingId") WHERE "bookingId" IS NOT NULL; | |
| 1 TYPE_UNKNOWN:AuditActorType | |
| e.g. ERROR: Unsupported type "AuditActorType" for column 'type' in table public.AuditActor | |
| SQL: CREATE TABLE "public"."AuditActor" ( "id" TEXT NOT NULL, "type" "public"."AuditActorType" NOT NULL, "userUuid" UUID, "attendeeId" INTEGER, "email" TEXT, "phone" TEXT, "name | |
| 1 TYPE_UNKNOWN:BookingAuditType | |
| e.g. ERROR: Unsupported type "BookingAuditType" for column 'type' in table public.BookingAudit | |
| SQL: CREATE TABLE "public"."BookingAudit" ( "id" UUID NOT NULL, "bookingUid" TEXT NOT NULL, "actorId" TEXT NOT NULL, "type" "public"."BookingAuditType" NOT NULL, "action" "public"."Book | |
| 1 TYPE_UNKNOWN:SeatChangeType | |
| e.g. ERROR: Unsupported type "SeatChangeType" for column 'changeType' in table public.SeatChangeLog | |
| SQL: "seatCount" INTEGER NOT NULL, "userId" INTEGER, "triggeredBy" INTEGER, "changeDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "monthKey" TEXT NOT NULL, "processedInProra | |
| 1 TYPE_UNKNOWN:ProrationStatus | |
| e.g. ERROR: Unsupported type "ProrationStatus" for column 'status' in table public.MonthlyProration | |
| SQL: "status" "public"."ProrationStatus" NOT NULL DEFAULT 'PENDING', "chargedAt" TIMESTAMP(3), "failedAt" TIMESTAMP(3), "failureReason" TEXT, "retryCount" INTEGER NOT NULL DEFAULT 0, | |
| 1 TYPE_UNKNOWN:WorkflowStepAutoTranslatedField | |
| e.g. ERROR: Unsupported type "WorkflowStepAutoTranslatedField" for column 'field' in table public.WorkflowStepTranslation | |
| SQL: CREATE TABLE "public"."WorkflowStepTranslation" ( "uid" TEXT NOT NULL, "workflowStepId" INTEGER NOT NULL, "field" "public"."WorkflowStepAutoTranslatedField" NOT NULL, "sourceLocale" TE | |
| 1 TYPE_UNKNOWN:WrongAssignmentReportStatus | |
| e.g. ERROR: Unsupported type "WrongAssignmentReportStatus" for column 'status' in table public.WrongAssignmentReport | |
| SQL: "id" UUID NOT NULL, "bookingUid" TEXT NOT NULL, "reportedById" INTEGER, "correctAssignee" TEXT, "additionalNotes" TEXT NOT NULL, "teamId" INTEGER, "routingFormId" TEXT, | |
| ---------------------------------------- | |
| === concourse === | |
| Total ERROR lines: 285 | |
| Unique categories: 6 | |
| 156 OTHER | |
| e.g. ERROR: relation "builds" does not exist | |
| SQL: ALTER SEQUENCE builds_id_seq OWNED BY builds.id; | |
| e.g. ERROR: relation "containers" does not exist | |
| SQL: ALTER SEQUENCE containers_id_seq OWNED BY containers.id; | |
| 57 NO_ADD_CONSTRAINT | |
| e.g. ERROR: unique constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY base_resource_types ADD CONSTRAINT base_resource_types_name_key UNIQUE (name); | |
| e.g. ERROR: primary key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY base_resource_types ADD CONSTRAINT base_resource_types_pkey PRIMARY KEY (id); | |
| 37 NO_FOREIGN_KEY | |
| e.g. ERROR: foreign key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY build_image_resource_caches ADD CONSTRAINT build_image_resource_caches_build_id_fkey FOREIGN KEY (build_id) REFERENCES builds(id) ON DELETE CASCADE; | |
| e.g. ERROR: foreign key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY build_image_resource_caches ADD CONSTRAINT build_image_resource_caches_resource_cache_id_fkey FOREIGN KEY (resource_cache_id) REFERENCES resource_caches(id) ON DELETE RESTRICT; | |
| 23 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "builds" does not exist | |
| SQL: ALTER TABLE ONLY builds ALTER COLUMN id SET DEFAULT nextval('builds_id_seq'::regclass); | |
| e.g. ERROR: relation "containers" does not exist | |
| SQL: ALTER TABLE ONLY containers ALTER COLUMN id SET DEFAULT nextval('containers_id_seq'::regclass); | |
| 9 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type build_status for column 'status' in table public.builds | |
| SQL: engine character varying(16), engine_metadata text, completed boolean DEFAULT false NOT NULL, job_id integer, reap_time timestamp with time zone, team_id integer NOT NULL, | |
| e.g. ERROR: Unsupported type container_state for column 'state' in table public.containers | |
| SQL: meta_working_directory text DEFAULT ''::text NOT NULL, meta_process_user text DEFAULT ''::text NOT NULL, meta_pipeline_id integer DEFAULT 0 NOT NULL, meta_job_id integer DEFAULT 0 NOT | |
| 3 NO_ON_CONFLICT | |
| e.g. ERROR: relation "resource_disabled_versions" does not exist | |
| SQL: SELECT vr.resource_id, md5(vr.version) FROM versioned_resources vr WHERE NOT enabled ON CONFLICT DO NOTHING; | |
| e.g. ERROR: relation "build_resource_config_version_inputs" does not exist | |
| SQL: SELECT bi.build_id, vr.resource_id, md5(vr.version), bi.name FROM build_inputs bi, versioned_resources vr WHERE bi.versioned_resource_id = vr.id ON CONFLICT DO NOTHING; | |
| ---------------------------------------- | |
| === discourse === | |
| Total ERROR lines: 1236 | |
| Unique categories: 11 | |
| 698 OTHER | |
| e.g. ERROR: relation "public.admin_notices" does not exist | |
| SQL: ALTER SEQUENCE public.admin_notices_id_seq OWNED BY public.admin_notices.id; | |
| e.g. ERROR: relation "public.ai_agent_mcp_servers" does not exist | |
| SQL: ALTER SEQUENCE public.ai_agent_mcp_servers_id_seq OWNED BY public.ai_agent_mcp_servers.id; | |
| 301 NO_ADD_CONSTRAINT | |
| e.g. ERROR: primary key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY public.ad_plugin_house_ads ADD CONSTRAINT ad_plugin_house_ads_pkey PRIMARY KEY (id); | |
| e.g. ERROR: primary key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY public.ad_plugin_impressions ADD CONSTRAINT ad_plugin_impressions_pkey PRIMARY KEY (id); | |
| 71 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type json for column 'details' in table public.admin_notices | |
| SQL: CREATE TABLE public.admin_notices ( id bigint NOT NULL, subject integer NOT NULL, priority integer NOT NULL, identifier character varying NOT NULL, details json DEFAULT '{}'::json | |
| e.g. ERROR: Unsupported type jsonb for column 'selected_tool_names' in table public.ai_agent_mcp_servers | |
| SQL: CREATE TABLE public.ai_agent_mcp_servers ( id bigint NOT NULL, ai_agent_id bigint NOT NULL, ai_mcp_server_id bigint NOT NULL, created_at timestamp(6) without time zone NOT NULL, up | |
| 64 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "public.admin_notices" does not exist | |
| SQL: ALTER TABLE ONLY public.admin_notices ALTER COLUMN id SET DEFAULT nextval('public.admin_notices_id_seq'::regclass); | |
| e.g. ERROR: relation "public.ai_agent_mcp_servers" does not exist | |
| SQL: ALTER TABLE ONLY public.ai_agent_mcp_servers ALTER COLUMN id SET DEFAULT nextval('public.ai_agent_mcp_servers_id_seq'::regclass); | |
| 62 NO_PARTIAL_INDEX | |
| e.g. ERROR: relation "public.chat_messages" does not exist | |
| SQL: CREATE INDEX idx_chat_messages_by_created_at_not_deleted ON public.chat_messages USING btree (created_at) WHERE (deleted_at IS NULL); | |
| e.g. ERROR: relation "public.chat_messages" does not exist | |
| SQL: CREATE INDEX idx_chat_messages_by_thread_id_not_deleted ON public.chat_messages USING btree (thread_id) WHERE (deleted_at IS NULL); | |
| 25 NO_FOREIGN_KEY | |
| e.g. ERROR: cannot create index on relation "upload_references" | |
| SQL: CREATE INDEX index_upload_references_on_target ON public.upload_references USING btree (target_type, target_id); | |
| e.g. ERROR: cannot create index on relation "upload_references" | |
| SQL: CREATE UNIQUE INDEX index_upload_references_on_upload_and_target ON public.upload_references USING btree (upload_id, target_type, target_id); | |
| 6 INDEX_TYPE_NOT_SUPPORTED:GIN | |
| e.g. ERROR: relation "public.category_search_data" does not exist | |
| SQL: CREATE INDEX idx_search_category ON public.category_search_data USING gin (search_data); | |
| e.g. ERROR: relation "public.chat_message_search_data" does not exist | |
| SQL: CREATE INDEX idx_search_chat_message ON public.chat_message_search_data USING gin (search_data); | |
| 4 NO_EXTENSION | |
| e.g. ERROR: extension "hstore" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public; | |
| e.g. ERROR: extension "pg_trgm" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public; | |
| 3 TYPE_UNKNOWN:public.halfvec | |
| e.g. ERROR: type "public.halfvec" does not exist | |
| SQL: CREATE TABLE public.ai_document_fragments_embeddings ( rag_document_fragment_id bigint NOT NULL, model_id bigint NOT NULL, model_version integer NOT NULL, strategy_id integer NOT NULL, | |
| e.g. ERROR: type "public.halfvec" does not exist | |
| SQL: CREATE TABLE public.ai_posts_embeddings ( post_id bigint NOT NULL, model_id bigint NOT NULL, model_version integer NOT NULL, strategy_id integer NOT NULL, strategy_version integer | |
| 1 INDEX_TYPE_NOT_SUPPORTED:BRIN | |
| e.g. ERROR: relation "public.browser_pageview_events" does not exist | |
| SQL: CREATE INDEX index_browser_pageview_events_on_created_at ON public.browser_pageview_events USING brin (created_at); | |
| 1 SEQUENCE_ERROR | |
| e.g. ERROR: cannot create index on relation "draft_sequences" | |
| SQL: CREATE UNIQUE INDEX index_draft_sequences_on_user_id_and_draft_key ON public.draft_sequences USING btree (user_id, draft_key); | |
| ---------------------------------------- | |
| === drone === | |
| Total ERROR lines: 442 | |
| Unique categories: 10 | |
| 279 OTHER | |
| e.g. ERROR: relation "migrations" does not exist | |
| SQL: ALTER TABLE migrations ADD PRIMARY KEY (version); | |
| e.g. ERROR: referenced relation "spaces" is not a table | |
| SQL: ,repo_fork_id INTEGER ,repo_pullreq_seq INTEGER NOT NULL ,repo_num_forks INTEGER NOT NULL ,repo_num_pulls INTEGER NOT NULL ,repo_num_closed_pulls INTEGER NOT NULL ,rep | |
| 102 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "pullreq_activities" does not exist | |
| SQL: ALTER TABLE pullreq_activities ADD COLUMN pullreq_activity_outdated BOOLEAN, ADD COLUMN pullreq_activity_code_comment_merge_base_sha TEXT, ADD COLUMN pullreq_activity_code_comment_source_s | |
| e.g. ERROR: relation "pullreqs" does not exist | |
| SQL: ALTER TABLE pullreqs ADD COLUMN pullreq_unresolved_count INTEGER NOT NULL DEFAULT 0; | |
| 15 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "pullreqs" does not exist | |
| SQL: ALTER TABLE pullreqs ADD CONSTRAINT fk_pullreq_source_repo_id FOREIGN KEY (pullreq_source_repo_id) REFERENCES repositories (repo_id) MATCH SIMPLE ON UPDATE NO ACTION ON DEL | |
| e.g. ERROR: relation "infra_provisioned" does not exist | |
| SQL: ALTER TABLE infra_provisioned ADD CONSTRAINT fk_iprov_gitspace_id FOREIGN KEY (iprov_gitspace_id) REFERENCES gitspaces (gits_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE | |
| 14 NO_PARTIAL_INDEX | |
| e.g. ERROR: cannot create index on relation "jobs" | |
| SQL: CREATE INDEX jobs_scheduled ON jobs(job_scheduled) WHERE job_state = 'scheduled'; | |
| e.g. ERROR: cannot create index on relation "jobs" | |
| SQL: CREATE INDEX jobs_run_deadline ON jobs(job_run_deadline) WHERE job_state = 'running'; | |
| 9 NO_EXTENSION | |
| e.g. ERROR: extension "btree_gin" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS btree_gin; | |
| e.g. ERROR: extension "citext" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS citext; | |
| 7 NO_PG_FUNCTION | |
| e.g. ERROR: function uuid_generate_v4() does not exist | |
| SQL: ( generic_blob_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), generic_blob_root_parent_id INTEGER NOT NULL, generic_blob_sha_1 BYTEA, generic_blob_sha_256 | |
| e.g. ERROR: function uuid_generate_v4() does not exist | |
| SQL: ( node_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), node_name TEXT NOT NULL, node_parent_id UUID REFERENCES nodes (node_id), node_registry_id IN | |
| 6 NO_FOREIGN_KEY | |
| e.g. ERROR: relation "manifest_references" does not exist | |
| SQL: create index if not exists index_manifest_references_on_rpstry_id_child_id on manifest_references (manifest_ref_registry_id, manifest_ref_child_id); | |
| e.g. ERROR: relation "manifest_references" does not exist | |
| SQL: CREATE TRIGGER gc_track_deleted_manifest_lists_trigger AFTER DELETE ON manifest_references FOR EACH ROW EXECUTE PROCEDURE gc_track_deleted_manifest_lists(); | |
| 4 NO_RULES | |
| e.g. ERROR: relation "rules" does not exist | |
| SQL: CREATE UNIQUE INDEX rules_space_id_uid ON rules(rule_space_id, LOWER(rule_uid)) WHERE rule_space_id IS NOT NULL; | |
| e.g. ERROR: relation "rules" does not exist | |
| SQL: CREATE UNIQUE INDEX rules_repo_id_uid ON rules(rule_repo_id, LOWER(rule_uid)) WHERE rule_repo_id IS NOT NULL; | |
| 4 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type interval for column 'value' in table public.gc_review_after_defaults | |
| SQL: create table if not exists gc_review_after_defaults ( event text NOT NULL, value interval NOT NULL, CONSTRAINT pk_gc_review_after_defaults PRIMARY KEY (event), CONSTRAINT check_gc_ | |
| e.g. ERROR: Unsupported type jsonb for column 'registry_task_payload' in table public.registry_tasks | |
| SQL: CREATE TABLE registry_tasks ( registry_task_key text PRIMARY KEY, registry_task_kind text NOT NULL, registry_task_payload jsonb, registry_task_status registry_t | |
| 2 NO_ON_CONFLICT | |
| e.g. ERROR: relation "gc_review_after_defaults" does not exist | |
| SQL: INSERT INTO gc_review_after_defaults (event, value) VALUES ('blob_upload', interval '1 day'), ('manifest_upload', interval '1 day'), ('manifest_delete', interval '1 day'), ('layer | |
| e.g. ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification | |
| SQL: INSERT INTO media_types (mt_media_type, is_runnable) VALUES ('application/vnd.dev.cosign.simplesigning.v1+json', false), ('application/vnd.dsse.envelope.v1+json', false) ON CONFLICT (mt_media_t | |
| ---------------------------------------- | |
| === gitlabhq === | |
| Total ERROR lines: 12 | |
| Unique categories: 6 | |
| 3 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type timestamp with time zone for column 'last_ci_minutes_notification_at' in table public.namespaces | |
| SQL: max_artifacts_size integer, mentions_disabled boolean, default_branch_protection smallint, max_personal_access_token_lifetime integer, push_rule_id bigint, shared_runners_enabl | |
| e.g. ERROR: Unsupported type date for column 'marked_for_deletion_at' in table public.projects | |
| SQL: pull_mirror_branch_prefix character varying(50), remove_source_branch_after_merge boolean, marked_for_deletion_at date, marked_for_deletion_by_user_id bigint, autoclose_referenced_ | |
| 2 NO_EXTENSION | |
| e.g. ERROR: extension "btree_gist" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS btree_gist; | |
| e.g. ERROR: extension "pg_trgm" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS pg_trgm; | |
| 2 TYPE_UNKNOWN:namespaces | |
| e.g. ERROR: type "namespaces" does not exist | |
| SQL: CREATE FUNCTION find_namespaces_by_id(namespaces_id bigint) RETURNS namespaces LANGUAGE plpgsql STABLE COST 1 PARALLEL SAFE AS $$ BEGIN return (SELECT namespaces FROM namespaces WHERE id = n | |
| e.g. ERROR: type "namespaces" does not exist | |
| SQL: CREATE FUNCTION find_namespaces_by_id_and_organization_id(namespaces_id bigint, sharding_organization_id bigint) RETURNS namespaces LANGUAGE plpgsql STABLE COST 1 PARALLEL SAFE AS $$ BEGIN r | |
| 2 TYPE_UNKNOWN:projects | |
| e.g. ERROR: type "projects" does not exist | |
| SQL: CREATE FUNCTION find_projects_by_id(projects_id bigint) RETURNS projects LANGUAGE plpgsql STABLE COST 1 PARALLEL SAFE AS $$ BEGIN return (SELECT projects FROM projects WHERE id = projects_id | |
| e.g. ERROR: type "projects" does not exist | |
| SQL: CREATE FUNCTION find_projects_by_id_and_organization_id(projects_id bigint, sharding_organization_id bigint) RETURNS projects LANGUAGE plpgsql STABLE COST 1 PARALLEL SAFE AS $$ BEGIN return | |
| 2 TYPE_UNKNOWN:users | |
| e.g. ERROR: type "users" does not exist | |
| SQL: CREATE FUNCTION find_users_by_id(users_id bigint) RETURNS users LANGUAGE plpgsql STABLE COST 1 PARALLEL SAFE AS $$ BEGIN return (SELECT users FROM users WHERE id = users_id LIMIT 1); END; $$ | |
| e.g. ERROR: type "users" does not exist | |
| SQL: CREATE FUNCTION find_users_by_id_and_organization_id(users_id bigint, sharding_organization_id bigint) RETURNS users LANGUAGE plpgsql STABLE COST 1 PARALLEL SAFE AS $$ BEGIN return (SELECT u | |
| 1 OTHER | |
| e.g. ERROR: unterminated dollar-quoted string at or near "$$ | |
| SQL: SELECT "group_id" INTO NEW."namespace_id" FROM "bulk_import_export_uploads" | |
| ---------------------------------------- | |
| === hydra === | |
| Total ERROR lines: 639 | |
| Unique categories: 8 | |
| 423 OTHER | |
| e.g. ERROR: relation "hydra_client" does not exist | |
| SQL: UPDATE hydra_client SET sector_identifier_uri='', jwks='', jwks_uri='', request_uris=''; | |
| e.g. ERROR: relation "hydra_client" does not exist | |
| SQL: UPDATE hydra_client SET allowed_cors_origins=''; | |
| 125 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "hydra_client" does not exist | |
| SQL: ALTER TABLE hydra_client ALTER COLUMN sector_identifier_uri SET NOT NULL; | |
| e.g. ERROR: relation "hydra_client" does not exist | |
| SQL: ALTER TABLE hydra_client ALTER COLUMN jwks SET NOT NULL; | |
| 82 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "hydra_oauth2_consent_request_handled" does not exist | |
| SQL: ALTER TABLE hydra_oauth2_consent_request_handled ADD CONSTRAINT hydra_oauth2_consent_request_handled_challenge_fk FOREIGN KEY (challenge) REFERENCES hydra_oauth2_consent_request(challenge) ON DELETE C | |
| e.g. ERROR: relation "hydra_oauth2_authentication_request_handled" does not exist | |
| SQL: ALTER TABLE hydra_oauth2_authentication_request_handled ADD CONSTRAINT hydra_oauth2_authentication_request_handled_challenge_fk FOREIGN KEY (challenge) REFERENCES hydra_oauth2_authentication_request(c | |
| 4 NO_EXTENSION | |
| e.g. ERROR: extension "uuid-ossp" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
| e.g. ERROR: extension "uuid-ossp" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
| 2 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type jsonb for column 'oidc_context' in table public.hydra_oauth2_flow | |
| SQL: consent_skip IS NOT NULL AND consent_csrf IS NOT NULL AND granted_scope IS NOT NULL AND consent_remember IS NOT NULL AND consent_remember_fo | |
| e.g. ERROR: Unsupported type jsonb for column 'oidc_context' in table public.hydra_oauth2_flow | |
| SQL: consent_skip IS NOT NULL AND consent_csrf IS NOT NULL AND granted_scope IS NOT NULL AND consent_remember IS NOT NULL AND consent_remember_fo | |
| 1 NO_PG_FUNCTION | |
| e.g. ERROR: function uuid_generate_v4() does not exist | |
| SQL: INSERT INTO networks (id, created_at, updated_at) VALUES (uuid_generate_v4(), '2013-10-07 08:23:19', '2013-10-07 08:23:19'); | |
| 1 OBJECT_EXISTS | |
| e.g. ERROR: relation "networks" already exists | |
| SQL: CREATE TABLE "networks" ( "id" UUID NOT NULL, PRIMARY KEY("id"), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL ); | |
| 1 SYNTAX_ERROR | |
| e.g. ERROR: syntax error at or near "uuid_generate_v4" | |
| SQL: INSERT INTO networks (id, created_at, updated_at) VALUES uuid_generate_v4(), '2013-10-07 08:23:19', '2013-10-07 08:23:19'); | |
| ---------------------------------------- | |
| === lemmy === | |
| Total ERROR lines: 914 | |
| Unique categories: 7 | |
| 819 OTHER | |
| e.g. ERROR: referenced relation "user_" is not a table | |
| SQL: CREATE TABLE user_ban ( id serial PRIMARY KEY, user_id int REFERENCES user_ ON UPDATE CASCADE ON DELETE CASCADE NOT NULL, published timestamp NOT NULL DEFAULT now(), UNIQUE (user_id) ) | |
| e.g. ERROR: referenced relation "category" is not a table | |
| SQL: CREATE TABLE community ( id serial PRIMARY KEY, name varchar(20) NOT NULL UNIQUE, title varchar(100) NOT NULL, description text, category_id int REFERENCES category ON UPDATE CASCA | |
| 78 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "community" does not exist | |
| SQL: ALTER TABLE community ADD COLUMN deleted boolean DEFAULT FALSE NOT NULL; | |
| e.g. ERROR: relation "post" does not exist | |
| SQL: ALTER TABLE post ADD COLUMN deleted boolean DEFAULT FALSE NOT NULL; | |
| 12 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "private_message" does not exist | |
| SQL: ALTER TABLE private_message ADD CONSTRAINT idx_private_message_ap_id UNIQUE (ap_id); | |
| e.g. ERROR: relation "post" does not exist | |
| SQL: ALTER TABLE post ADD CONSTRAINT idx_post_ap_id UNIQUE (ap_id); | |
| 2 NO_EXTENSION | |
| e.g. ERROR: extension "pgcrypto" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS pgcrypto; | |
| e.g. ERROR: extension "ltree" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS ltree; | |
| 1 INDEX_TYPE_NOT_SUPPORTED:GIST | |
| e.g. ERROR: relation "comment" does not exist | |
| SQL: CREATE INDEX idx_path_gist ON comment USING gist (path); | |
| 1 NO_FOREIGN_KEY | |
| e.g. ERROR: foreign key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE person ADD COLUMN instance_id int REFERENCES instance ON UPDATE CASCADE ON DELETE CASCADE; | |
| 1 NO_ON_CONFLICT | |
| e.g. ERROR: relation "local_user_language" does not exist | |
| SQL: SELECT id, 0 FROM local_user ON CONFLICT (local_user_id, language_id) DO NOTHING; | |
| ---------------------------------------- | |
| === listmonk === | |
| Total ERROR lines: 38 | |
| Unique categories: 3 | |
| 33 OTHER | |
| e.g. ERROR: relation "subscribers" does not exist | |
| SQL: CREATE UNIQUE INDEX idx_subs_email ON subscribers(LOWER(email)); | |
| e.g. ERROR: relation "subscribers" does not exist | |
| SQL: CREATE INDEX idx_subs_status ON subscribers(status); | |
| 4 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type jsonb for column 'attribs' in table public.subscribers | |
| SQL: CREATE TABLE subscribers ( id SERIAL PRIMARY KEY, uuid uuid NOT NULL UNIQUE, email TEXT NOT NULL UNIQUE, name TEXT NOT NULL, attribs | |
| e.g. ERROR: Unsupported type list_type for column 'type' in table public.lists | |
| SQL: CREATE TABLE lists ( id SERIAL PRIMARY KEY, uuid uuid NOT NULL UNIQUE, name TEXT NOT NULL, type list_type NOT NULL, optin li | |
| 1 NO_EXTENSION | |
| e.g. ERROR: extension "pgcrypto" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS pgcrypto; | |
| ---------------------------------------- | |
| === mattermost === | |
| Total ERROR lines: 430 | |
| Unique categories: 8 | |
| 193 OTHER | |
| e.g. ERROR: relation "teams" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS idx_teams_invite_id ON teams (inviteid); | |
| e.g. ERROR: relation "teams" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS idx_teams_update_at ON teams (updateat); | |
| 146 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "teams" does not exist | |
| SQL: ALTER TABLE teams ADD COLUMN IF NOT EXISTS allowopeninvite boolean; | |
| e.g. ERROR: relation "teams" does not exist | |
| SQL: ALTER TABLE teams ADD COLUMN IF NOT EXISTS lastteamiconupdate bigint; | |
| 53 OBJECT_EXISTS | |
| e.g. ERROR: Table 'public/teams' already exists in YDB | |
| SQL: deleteat bigint, displayname VARCHAR(64), name VARCHAR(64), description VARCHAR(255), email VARCHAR(128), type VARCHAR(255), companyname VARCHAR(64), alloweddomains VAR | |
| e.g. ERROR: Table 'public/teammembers' already exists in YDB | |
| SQL: CREATE TABLE IF NOT EXISTS teammembers ( teamid VARCHAR(26) NOT NULL, userid VARCHAR(26) NOT NULL, roles VARCHAR(64), deleteat bigint, PRIMARY KEY (teamid, userid) ); psql:projects | |
| 11 INDEX_TYPE_NOT_SUPPORTED:GIN | |
| e.g. ERROR: relation "posts" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS idx_posts_message_txt ON posts USING gin(to_tsvector('english', message)); | |
| e.g. ERROR: relation "posts" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS idx_posts_hashtags_txt ON posts USING gin(to_tsvector('english', hashtags)); | |
| 10 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type jsonb for column 'query' in table public.recentsearches | |
| SQL: CREATE TABLE IF NOT EXISTS recentsearches ( userid CHAR(26), searchpointer int, query jsonb, createat bigint NOT NULL, PRIMARY KEY (userid, searchpointer) ); psql:projects/mattermo | |
| e.g. ERROR: Unsupported type character varying[] for column 'ids' in table public.retentionidsfordeletion | |
| SQL: CREATE TABLE IF NOT EXISTS retentionidsfordeletion ( id varchar(26) PRIMARY KEY, tablename varchar(64), ids varchar(26)[] ); psql:projects/mattermost/server/channels/db/migrations/postgres | |
| 7 NO_FOREIGN_KEY | |
| e.g. ERROR: Table 'public/preferences' already exists in YDB | |
| SQL: CREATE TABLE IF NOT EXISTS preferences ( userid varchar(26) NOT NULL, category varchar(32) NOT NULL, name varchar(32) NOT NULL, value varchar(2000), PRIMARY KEY (userid, category, | |
| e.g. ERROR: relation "preferences" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS idx_preferences_category ON preferences(category); | |
| 6 NO_PARTIAL_INDEX | |
| e.g. ERROR: relation "channelmembers" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS idx_channelmembers_autotranslation_enabled ON channelmembers (channelid) WHERE autotranslation = true; | |
| e.g. ERROR: relation "channels" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS idx_channels_autotranslation_enabled ON channels (id) WHERE autotranslation = true; | |
| 4 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "oauthaccessdata" does not exist | |
| SQL: ALTER TABLE oauthaccessdata ADD CONSTRAINT oauthaccessdata_clientid_userid_key UNIQUE (clientid, userid); END IF; END $$; | |
| e.g. ERROR: relation "sharedchannelusers" does not exist | |
| SQL: ALTER TABLE sharedchannelusers ADD CONSTRAINT sharedchannelusers_userid_channelid_remoteid_key UNIQUE (userid, channelid, remoteid); END IF; END $$; | |
| ---------------------------------------- | |
| === miniflux === | |
| Total ERROR lines: 74 | |
| Unique categories: 3 | |
| 66 SYNTAX_ERROR | |
| e.g. ERROR: syntax error at or near "," | |
| SQL: return err } defer tx.Exec("CLOSE my_cursor") for { var ( userID int64 customStylesheet string googleID string oidcID string ) if err := t | |
| e.g. ERROR: syntax error at or near "err" | |
| SQL: ; , userID, customStylesheet, googleID, oidcID) if err != nil { return err } } return err }, func(tx *sql.Tx) (err error) { if _, err = tx.Exec( ; ); | |
| 7 OTHER | |
| e.g. ERROR: relation "users" does not exist | |
| SQL: CREATE TABLE sessions ( id SERIAL, user_id int not null, token text not null unique, created_at timestamp with time zone default now(), user_agent text, ip text, primary ke | |
| e.g. ERROR: relation "users" does not exist | |
| SQL: CREATE TABLE categories ( id SERIAL, user_id int not null, title text not null, primary key (id), unique (user_id, title), foreign key (user_id) references users(id) on delete | |
| 1 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type timestamp with time zone for column 'last_login_at' in table public.users | |
| SQL: CREATE TABLE users ( id SERIAL, username text not null unique, password text, is_admin bool default 'f', language text default 'en_US', timezone text default 'UTC', theme t | |
| ---------------------------------------- | |
| === pagila === | |
| Total ERROR lines: 4 | |
| Unique categories: 4 | |
| 1 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type date for column 'create_date' in table public.customer | |
| SQL: CREATE TABLE public.customer ( customer_id integer DEFAULT nextval('public.customer_customer_id_seq'::regclass) NOT NULL, store_id integer NOT NULL, first_name text NOT NULL, last_name | |
| 1 OTHER | |
| e.g. ERROR: relation "public.customer" does not exist | |
| SQL: ALTER TABLE public.customer OWNER TO postgres; | |
| 1 TYPE_UNKNOWN:public.customer | |
| e.g. ERROR: type "public.customer" does not exist | |
| SQL: RETURN; END $_$; | |
| 1 NO_PG_FUNCTION | |
| e.g. ERROR: function public.rewards_report(integer, numeric) does not exist | |
| SQL: ALTER FUNCTION public.rewards_report(min_monthly_purchases integer, min_dollar_amount_purchased numeric) OWNER TO postgres; | |
| ---------------------------------------- | |
| === plausible === | |
| Total ERROR lines: 187 | |
| Unique categories: 11 | |
| 54 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "public.api_keys" does not exist | |
| SQL: ALTER TABLE ONLY public.api_keys ADD CONSTRAINT api_keys_pkey PRIMARY KEY (id); | |
| e.g. ERROR: primary key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY public.check_stats_emails ADD CONSTRAINT check_stats_emails_pkey PRIMARY KEY (id); | |
| 49 OTHER | |
| e.g. ERROR: relation "plausible_events_db.schema_migrations" does not exist | |
| SQL: (20240123142959,'2024-09-11 09:23:21'), (20240209085338,'2024-09-11 09:23:21'), (20240220123656,'2024-09-11 09:23:21'), (20240222082911,'2024-09-11 09:23:21'), (20240305085310,'2024-09-11 09:23:21'), | |
| e.g. ERROR: relation "public.api_keys" does not exist | |
| SQL: ALTER SEQUENCE public.api_keys_id_seq OWNED BY public.api_keys.id; | |
| 27 NO_FOREIGN_KEY | |
| e.g. ERROR: cannot create index on relation "site_user_preferences" | |
| SQL: CREATE UNIQUE INDEX site_user_preferences_user_id_site_id_index ON public.site_user_preferences USING btree (user_id, site_id); | |
| e.g. ERROR: foreign key constraints are not supported on foreign tables | |
| SQL: ALTER TABLE ONLY public.check_stats_emails ADD CONSTRAINT check_stats_emails_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE; | |
| 17 SYNTAX_ERROR | |
| e.g. ERROR: syntax error at or near "`" | |
| SQL: `source` String ALIAS referrer_source, `country_name` String ALIAS dictGet('plausible_events_db.location_data_dict', 'name', ('country', country_code)), `region_name` String ALIAS dictGet( | |
| e.g. ERROR: syntax error at or near "DICTIONARY" | |
| SQL: CREATE DICTIONARY plausible_events_db.location_data_dict ( `type` String, `id` String, `name` String ) PRIMARY KEY type, id SOURCE(CLICKHOUSE(TABLE location_data DB 'plausible_events_db')) | |
| 14 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "public.api_keys" does not exist | |
| SQL: ALTER TABLE ONLY public.api_keys ALTER COLUMN id SET DEFAULT nextval('public.api_keys_id_seq'::regclass); | |
| e.g. ERROR: relation "public.enterprise_plans" does not exist | |
| SQL: ALTER TABLE ONLY public.enterprise_plans ALTER COLUMN id SET DEFAULT nextval('public.enterprise_plans_id_seq'::regclass); | |
| 10 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type text[] for column 'scopes' in table public.api_keys | |
| SQL: CREATE TABLE public.api_keys ( id bigint NOT NULL, user_id bigint NOT NULL, name character varying(255) NOT NULL, key_prefix character varying(255) NOT NULL, key_hash character var | |
| e.g. ERROR: Unsupported type public.billing_interval for column 'billing_interval' in table public.enterprise_plans | |
| SQL: id bigint NOT NULL, user_id bigint NOT NULL, paddle_plan_id character varying(255) NOT NULL, billing_interval public.billing_interval NOT NULL, monthly_pageview_limit integer NOT N | |
| 6 NO_RULES | |
| e.g. ERROR: relation "public.shield_rules_ip" does not exist | |
| SQL: ALTER TABLE ONLY public.shield_rules_ip ADD CONSTRAINT shield_rules_ip_pkey PRIMARY KEY (id); | |
| e.g. ERROR: cannot create index on relation "shield_rules_country" | |
| SQL: CREATE UNIQUE INDEX shield_rules_country_site_id_country_code_index ON public.shield_rules_country USING btree (site_id, country_code); | |
| 3 TYPE_UNKNOWN:public.citext[] | |
| e.g. ERROR: type "public.citext[]" does not exist | |
| SQL: CREATE TABLE public.monthly_reports ( id bigint NOT NULL, site_id bigint NOT NULL, inserted_at timestamp(0) without time zone NOT NULL, updated_at timestamp(0) without time zone NOT NU | |
| e.g. ERROR: type "public.citext[]" does not exist | |
| SQL: CREATE TABLE public.spike_notifications ( id bigint NOT NULL, site_id bigint NOT NULL, threshold integer NOT NULL, last_sent timestamp(0) without time zone, recipients public.citex | |
| 3 INDEX_TYPE_NOT_SUPPORTED:GIN | |
| e.g. ERROR: relation "public.api_keys" does not exist | |
| SQL: CREATE INDEX api_keys_scopes_index ON public.api_keys USING gin (scopes); | |
| e.g. ERROR: relation "public.oban_jobs" does not exist | |
| SQL: CREATE INDEX oban_jobs_args_index ON public.oban_jobs USING gin (args); | |
| 2 NO_EXTENSION | |
| e.g. ERROR: extension "citext" is not available | |
| SQL: CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public; | |
| e.g. ERROR: extension "citext" does not exist | |
| SQL: COMMENT ON EXTENSION citext IS 'data type for case-insensitive character strings'; | |
| 2 TYPE_UNKNOWN:public.citext | |
| e.g. ERROR: type "public.citext" does not exist | |
| SQL: CREATE TABLE public.invitations ( id bigint NOT NULL, email public.citext NOT NULL, site_id bigint NOT NULL, inviter_id bigint NOT NULL, role public.site_membership_role NOT NULL, | |
| e.g. ERROR: type "public.citext" does not exist | |
| SQL: trial_expiry_date date, email_verified boolean DEFAULT false NOT NULL, theme character varying(255) DEFAULT 'system'::character varying, grace_period jsonb, previous_email public.c | |
| ---------------------------------------- | |
| === woodpecker === | |
| Total ERROR lines: 84 | |
| Unique categories: 4 | |
| 56 OTHER | |
| e.g. ERROR: unrecognized configuration parameter "transaction_timeout" | |
| SQL: SET transaction_timeout = 0; | |
| e.g. ERROR: relation "public.agents" does not exist | |
| SQL: ALTER TABLE public.agents OWNER TO postgres; | |
| 17 NO_ADD_CONSTRAINT | |
| e.g. ERROR: relation "public.agents" does not exist | |
| SQL: ALTER TABLE ONLY public.agents ADD CONSTRAINT agents_pkey PRIMARY KEY (id); | |
| e.g. ERROR: relation "public.pipelines" does not exist | |
| SQL: ALTER TABLE ONLY public.pipelines ADD CONSTRAINT builds_pkey PRIMARY KEY (id); | |
| 6 TYPE_UNKNOWN | |
| e.g. ERROR: Unsupported type json for column 'custom_labels' in table public.agents | |
| SQL: owner_id bigint, token character varying(255), last_contact bigint, platform character varying(100), backend character varying(100), capacity integer, version character var | |
| e.g. ERROR: Unsupported type json for column 'additional_variables' in table public.pipelines | |
| SQL: reviewer character varying(250), reviewed integer, sender character varying(250), changed_files text, updated bigint DEFAULT 0 NOT NULL, additional_variables json, pr_label | |
| 5 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: relation "public.agents" does not exist | |
| SQL: ALTER TABLE ONLY public.agents ALTER COLUMN id SET DEFAULT nextval('public.agents_id_seq'::regclass); | |
| e.g. ERROR: relation "public.forges" does not exist | |
| SQL: ALTER TABLE ONLY public.forges ALTER COLUMN id SET DEFAULT nextval('public.forge_id_seq'::regclass); | |
| ---------------------------------------- | |
| === zitadel === | |
| Total ERROR lines: 48 | |
| Unique categories: 5 | |
| 36 OTHER | |
| e.g. ERROR: schema "adminapi" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS current_sequences_instance_id_idx ON adminapi.current_sequences (instance_id); | |
| e.g. ERROR: schema "auth" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS current_sequences_instance_id_idx ON auth.current_sequences (instance_id); | |
| 5 ALTER_COL_NOT_REDIRECTED | |
| e.g. ERROR: schema "adminapi" does not exist | |
| SQL: ALTER TABLE adminapi.failed_events ADD COLUMN IF NOT EXISTS last_failed TIMESTAMPTZ; | |
| e.g. ERROR: schema "auth" does not exist | |
| SQL: ALTER TABLE auth.failed_events ADD COLUMN IF NOT EXISTS last_failed TIMESTAMPTZ; | |
| 4 NO_PARTIAL_INDEX | |
| e.g. ERROR: schema "eventstore" does not exist | |
| SQL: CREATE INDEX CONCURRENTLY IF NOT EXISTS active_instances_events ON eventstore.events2 (aggregate_type, event_type) WHERE aggregate_type = 'instance' AND event_type IN ('instance.added', 'instance.remo | |
| e.g. ERROR: schema "eventstore" does not exist | |
| SQL: CREATE INDEX IF NOT EXISTS f_number_value_idx ON eventstore.fields (instance_id, object_type, field_name, number_value) INCLUDE (resource_owner, object_id, object_revision, "value") WHERE numb | |
| 2 NO_ON_CONFLICT | |
| e.g. ERROR: relation "projections.current_states" does not exist | |
| SQL: SELECT instance_id , 'projections.notifications_back_channel_logout' , now() , $1 , $2 , $3 , 0 FROM eventstore.events2 WHERE aggr | |
| e.g. ERROR: relation "projections.current_states" does not exist | |
| SQL: , now() , $1 , $2 , $3 , 0 FROM eventstore.events2 AS e WHERE aggregate_type = 'instance' AND event_type = 'instance.added' ON CONFLICT (instance_id, projection_name) DO UPD | |
| 1 NO_ADD_CONSTRAINT | |
| e.g. ERROR: schema "projections" does not exist | |
| SQL: ALTER TABLE projections.resource_counts ADD CONSTRAINT unique_resource UNIQUE (instance_id, parent_type, parent_id, table_name, resource_name); | |
| ---------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import re | |
| import sys | |
| from pathlib import Path | |
| log = Path(sys.argv[1]).read_text(errors='replace') | |
| blocks = re.findall( | |
| r"EXPLAIN \(VERBOSE, COSTS OFF\) (.+?);.*?\n(.*?)(?=\n(?:EXPLAIN|SELECT|INSERT|UPDATE|DELETE|PREPARE|BEGIN|##|DROP|--|\Z))", | |
| log, re.DOTALL) | |
| print("--- EXPLAIN classification ---") | |
| for q, plan in blocks[:50]: | |
| q1 = q.strip().replace('\n', ' ')[:100] | |
| has_remote = "Remote SQL" in plan or "Remote Filter" in plan | |
| has_filter_local = re.search(r"\n\s+Filter:", plan) is not None | |
| has_sort_local = re.search(r"\n\s+->\s+Sort", plan) is not None or "Sort Key:" in plan | |
| has_winagg = "WindowAgg" in plan | |
| has_agg = "Aggregate" in plan | |
| has_fs = "Foreign Scan" in plan | |
| has_recursive = "Recursive" in plan or "WorkTable Scan" in plan | |
| has_subplan = "SubPlan" in plan or "InitPlan" in plan | |
| has_limit_local = re.search(r"^\s*Limit", plan, re.M) is not None | |
| cls = [] | |
| if has_fs: | |
| cls.append("ForeignScan") | |
| if has_remote: | |
| cls.append("REMOTE-pushed") | |
| if has_filter_local: | |
| cls.append("LOCAL-Filter") | |
| if has_sort_local: | |
| cls.append("LOCAL-Sort") | |
| if has_winagg: | |
| cls.append("LOCAL-Window") | |
| if has_agg and "Aggregate" in plan.split("Foreign Scan")[0] if has_fs else has_agg: | |
| cls.append("LOCAL-Agg") | |
| if has_recursive: | |
| cls.append("RecursiveCTE") | |
| if has_subplan: | |
| cls.append("SubPlan-local") | |
| if has_limit_local: | |
| cls.append("LOCAL-Limit") | |
| print(f" {','.join(cls) or '???':<48} :: {q1}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Run a project's schema SQL through ydb_fdw and capture every error with | |
| # attribution to the SQL statement that produced it. | |
| # | |
| # Usage: run_project.sh <project-name> <sql-file> [sql-file ...] | |
| # | |
| # Outputs: | |
| # /workdir/empirical/results/<project>/run.log — raw psql output | |
| # /workdir/empirical/results/<project>/errors.tsv — failure rows | |
| # /workdir/empirical/results/<project>/summary.txt — grouped counts | |
| set -u | |
| PROJECT="$1" | |
| shift | |
| OUT=/workdir/empirical/results/$PROJECT | |
| mkdir -p "$OUT" | |
| DB="test_$PROJECT" | |
| PSQL_ADMIN="/usr/local/pgsql/bin/psql -h /tmp -p 5433 -U postgres -v ON_ERROR_STOP=0 -X -q" | |
| $PSQL_ADMIN -c "DROP DATABASE IF EXISTS $DB;" 2>&1 | grep -v 'NOTICE' || true | |
| $PSQL_ADMIN -c "CREATE DATABASE $DB;" >/dev/null | |
| # Clean YDB sub-tree for this project so re-runs are fresh. | |
| if command -v ydb >/dev/null 2>&1; then | |
| ydb -e grpc://localhost:2136 -d /local scheme rmdir --recursive --force "/$PROJECT" 2>/dev/null || true | |
| fi | |
| PSQL="/usr/local/pgsql/bin/psql -h /tmp -p 5433 -U postgres -d $DB -v ON_ERROR_STOP=0 -X -q" | |
| $PSQL <<EOF >/dev/null 2>&1 | |
| CREATE EXTENSION ydb_fdw; | |
| CREATE SERVER ydb FOREIGN DATA WRAPPER ydb_fdw OPTIONS ( | |
| connection_string 'localhost:2136/?database=/local', | |
| redirect_ddl 'full', | |
| tables_prefix '$PROJECT' | |
| ); | |
| EOF | |
| # Clean YDB side | |
| $PSQL -c "SELECT ydb_query_exec('DROP TABLE IF EXISTS \`$PROJECT/_ydb_pg_extension/pg_tables\`');" >/dev/null 2>&1 || true | |
| # Now feed each SQL file. `-e` echoes statements; we keep going on errors. | |
| : > "$OUT/run.log" | |
| for f in "$@"; do | |
| echo "=== FILE: $f ===" >> "$OUT/run.log" | |
| $PSQL -e -f "$f" >> "$OUT/run.log" 2>&1 | |
| done | |
| # Extract errors with context. | |
| # psql with -e emits each statement before its result; failure lines start with "ERROR:" | |
| # Strategy: scan the log, when we see "ERROR:" go back up to find the most recent | |
| # non-empty, non-NOTICE, non-COMMENT line that's a SQL statement. | |
| python3 - "$OUT/run.log" "$OUT/errors.tsv" "$OUT/summary.txt" "$PROJECT" <<'PY' | |
| import re | |
| import sys | |
| from collections import defaultdict, Counter | |
| from pathlib import Path | |
| log = Path(sys.argv[1]).read_text(errors='replace') | |
| errors_out = Path(sys.argv[2]) | |
| summary_out = Path(sys.argv[3]) | |
| project = sys.argv[4] | |
| lines = log.splitlines() | |
| errors = [] | |
| ERR_PREFIX_RE = re.compile(r'^(?:psql:[^:]+:\d+:\s*)?ERROR:\s*(.*)') | |
| def strip_psql_prefix(s: str) -> str: | |
| m = re.match(r'^psql:[^:]+:\d+:\s*', s) | |
| return s[m.end():] if m else s | |
| i = 0 | |
| while i < len(lines): | |
| line = lines[i] | |
| m = ERR_PREFIX_RE.match(line) | |
| if m: | |
| # walk back to last SQL statement (heuristic: lines that aren't NOTICE/HINT/CONTEXT/LINE/etc. and end with ; or contain DDL keywords) | |
| sql_lines = [] | |
| j = i - 1 | |
| while j >= 0: | |
| l = lines[j].rstrip() | |
| if l.startswith(('NOTICE:', 'HINT:', 'CONTEXT:', 'DETAIL:', 'STATEMENT:', 'LINE ', '=== FILE:')): | |
| break | |
| if l.startswith('ERROR:'): | |
| break | |
| if not l.strip(): | |
| if sql_lines: | |
| break | |
| j -= 1 | |
| continue | |
| sql_lines.insert(0, l) | |
| # stop when we have ~10 lines or hit a likely start of stmt | |
| if len(sql_lines) > 12: | |
| break | |
| if re.match(r'^\s*(CREATE|ALTER|DROP|INSERT|UPDATE|DELETE|SELECT|GRANT|SET|COMMENT|COPY|TRUNCATE|REVOKE|REFRESH|MERGE)\b', l, re.I): | |
| break | |
| j -= 1 | |
| # find the surrounding file | |
| file_marker = None | |
| for k in range(i, -1, -1): | |
| if lines[k].startswith('=== FILE: '): | |
| file_marker = lines[k][len('=== FILE: '):].rstrip(' =').rstrip() | |
| break | |
| err = strip_psql_prefix(lines[i]) | |
| # collect HINT/DETAIL/CONTEXT lines following the ERROR | |
| ctx = [] | |
| k = i + 1 | |
| while k < len(lines): | |
| stripped = strip_psql_prefix(lines[k]) | |
| if stripped.startswith(('HINT:', 'DETAIL:', 'CONTEXT:', 'LINE ')): | |
| ctx.append(stripped) | |
| k += 1 | |
| else: | |
| break | |
| errors.append({ | |
| 'file': file_marker or '?', | |
| 'error': err, | |
| 'context': ' || '.join(ctx), | |
| 'sql': ' '.join(sql_lines)[:400], | |
| }) | |
| i += 1 | |
| # Classify error patterns | |
| def classify(err: str, sql: str) -> str: | |
| el = err.lower() | |
| sl = sql.lower() | |
| if 'type' in el and ('does not exist' in el or 'unsupported' in el): | |
| m = re.search(r'type "([^"]+)"', err) | |
| if m: | |
| return f'TYPE_UNKNOWN:{m.group(1)}' | |
| return 'TYPE_UNKNOWN' | |
| if 'savepoint' in el or 'subtransaction' in el: | |
| return 'NO_SAVEPOINTS' | |
| if 'partition' in el: | |
| return 'NO_PARTITIONING' | |
| if 'foreign key' in el or 'references' in el: | |
| return 'NO_FOREIGN_KEY' | |
| if 'check' in el and 'constraint' in el: | |
| return 'NO_CHECK_CONSTRAINT' | |
| if 'trigger' in el: | |
| return 'NO_TRIGGERS' | |
| if 'rule' in el: | |
| return 'NO_RULES' | |
| if 'inherit' in el: | |
| return 'NO_INHERITS' | |
| if 'collation' in el or 'collate' in el: | |
| return 'NO_COLLATE' | |
| if 'sequence' in el: | |
| return 'SEQUENCE_ERROR' | |
| if 'extension' in el: | |
| return 'NO_EXTENSION' | |
| if 'tablespace' in el: | |
| return 'NO_TABLESPACE' | |
| if 'enum' in el: | |
| return 'NO_ENUM_TYPE' | |
| if 'function' in el and 'does not exist' in el: | |
| return 'NO_PG_FUNCTION' | |
| if 'identity' in el: | |
| return 'NO_IDENTITY' | |
| if 'generated' in el: | |
| return 'NO_GENERATED_COLUMN' | |
| if 'returning' in el: | |
| return 'NO_RETURNING' | |
| if 'on conflict' in sl: | |
| return 'NO_ON_CONFLICT' | |
| if 'using gin' in sl or 'using gist' in sl or 'using brin' in sl or 'using hash' in sl: | |
| m = re.search(r'using (\w+)', sl, re.I) | |
| return f'INDEX_TYPE_NOT_SUPPORTED:{m.group(1).upper() if m else "?"}' | |
| if 'create view' in sl: | |
| return 'NO_VIEW' | |
| if 'create materialized' in sl: | |
| return 'NO_MATVIEW' | |
| if 'create type' in sl and ' enum' in sl: | |
| return 'NO_ENUM_TYPE' | |
| if 'create type' in sl: | |
| return 'NO_CUSTOM_TYPE' | |
| if 'create domain' in sl: | |
| return 'NO_DOMAIN' | |
| if 'alter table' in sl and 'alter column' in sl: | |
| return 'ALTER_COL_NOT_REDIRECTED' | |
| if 'alter table' in sl and ('add column' in sl or 'drop column' in sl): | |
| return 'ALTER_COL_NOT_REDIRECTED' | |
| if 'alter table' in sl and 'add constraint' in sl: | |
| return 'NO_ADD_CONSTRAINT' | |
| if 'alter table' in sl and 'attach partition' in sl: | |
| return 'NO_PARTITIONING' | |
| if 'create index' in sl and ' where ' in sl: | |
| return 'NO_PARTIAL_INDEX' | |
| if 'syntax error' in el: | |
| return 'SYNTAX_ERROR' | |
| if 'already exists' in el: | |
| return 'OBJECT_EXISTS' | |
| return 'OTHER' | |
| counts = Counter() | |
| examples = defaultdict(list) | |
| with errors_out.open('w') as f: | |
| f.write('file\tcategory\terror\tsql\n') | |
| for e in errors: | |
| cat = classify(e['error'], e['sql']) | |
| counts[cat] += 1 | |
| if len(examples[cat]) < 3: | |
| examples[cat].append(e) | |
| f.write(f"{e['file']}\t{cat}\t{e['error']}\t{e['sql']}\n") | |
| with summary_out.open('w') as f: | |
| f.write(f'=== {project} ===\n') | |
| f.write(f'Total ERROR lines: {sum(counts.values())}\n') | |
| f.write(f'Unique categories: {len(counts)}\n\n') | |
| for cat, n in counts.most_common(): | |
| f.write(f' {n:>5} {cat}\n') | |
| for ex in examples[cat][:2]: | |
| f.write(f' e.g. {ex["error"]}\n') | |
| if ex['sql']: | |
| f.write(f' SQL: {ex["sql"][:200]}\n') | |
| print(f'[{project}] {sum(counts.values())} errors across {len(counts)} categories') | |
| PY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Runtime probe: realistic ORM-style queries against a normal foreign table. | |
| -- Goal: distinguish what physically fails vs what executes but pathologically slow. | |
| \set ON_ERROR_STOP 0 | |
| \set ECHO queries | |
| \timing on | |
| -- ===== Setup: a typical "users" table (works as a baseline) ===== | |
| DROP TABLE IF EXISTS probe_users; | |
| CREATE TABLE probe_users ( | |
| id BIGINT PRIMARY KEY, | |
| email TEXT NOT NULL, | |
| name TEXT, | |
| is_active BOOLEAN, | |
| created_at TIMESTAMP NOT NULL, | |
| updated_at TIMESTAMP NOT NULL, | |
| score INTEGER | |
| ); | |
| INSERT INTO probe_users(id, email, name, is_active, created_at, updated_at, score) | |
| SELECT g, 'user'||g||'@example.com', 'name '||g, (g % 2 = 0), | |
| NOW() - (g || ' minutes')::INTERVAL, NOW(), g*7 | |
| FROM generate_series(1, 5000) g; | |
| -- ===== Baseline: simple lookups that SHOULD push down ===== | |
| SELECT '## BASELINE pushdown' AS section; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE id = 42; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE id IN (1,2,3); | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE id BETWEEN 100 AND 200; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT id FROM probe_users ORDER BY id LIMIT 10; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT COUNT(*) FROM probe_users; | |
| -- ===== ORM-typical patterns that DO NOT push down ===== | |
| SELECT '## ORM patterns — LOCAL FILTER (full scan)' AS section; | |
| -- Django: User.objects.filter(email__iexact='X') | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE LOWER(email) = 'user42@example.com'; | |
| -- Django: User.objects.filter(name__icontains='foo') → ILIKE | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE name ILIKE '%foo%'; | |
| -- Django: User.objects.filter(name__regex='^name') | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE name ~ '^name'; | |
| -- Django: User.objects.filter(email__startswith='admin') → expression is fine, but case-insensitive __istartswith → LOWER | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE LOWER(email) LIKE 'admin%'; | |
| -- Rails: scope :recent, -> { where('created_at >= ?', 1.day.ago) } — pushable, but with NOW()-based math: | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM probe_users WHERE created_at >= NOW() - INTERVAL '1 day'; | |
| -- Common pagination idiom: window-based | |
| EXPLAIN (VERBOSE, COSTS OFF) | |
| SELECT id, ROW_NUMBER() OVER (ORDER BY id) AS rn FROM probe_users ORDER BY id LIMIT 10; | |
| -- Aggregation with FILTER | |
| EXPLAIN (VERBOSE, COSTS OFF) | |
| SELECT COUNT(*) FILTER (WHERE is_active), COUNT(*) FROM probe_users; | |
| -- Aggregate with DISTINCT (only COUNT supports DISTINCT in FDW) | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT SUM(DISTINCT score) FROM probe_users; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT AVG(DISTINCT score) FROM probe_users; | |
| -- GROUP BY expression (not bare column) | |
| EXPLAIN (VERBOSE, COSTS OFF) | |
| SELECT DATE_TRUNC('day', created_at) AS d, COUNT(*) FROM probe_users GROUP BY 1; | |
| -- ===== DML that ORMs do all the time ===== | |
| SELECT '## DML — RETURNING / ON CONFLICT' AS section; | |
| -- INSERT ... RETURNING id (every Django save()) | |
| INSERT INTO probe_users(id, email, name, is_active, created_at, updated_at, score) | |
| VALUES (10001, 'x@x', 'x', true, NOW(), NOW(), 1) RETURNING id; | |
| -- INSERT ... ON CONFLICT DO UPDATE (Django bulk_create with update_conflicts=True, Rails upsert) | |
| INSERT INTO probe_users(id, email, name, is_active, created_at, updated_at, score) | |
| VALUES (10001, 'x@y', 'y', true, NOW(), NOW(), 2) | |
| ON CONFLICT (id) DO UPDATE SET email = EXCLUDED.email RETURNING id; | |
| INSERT INTO probe_users(id, email, name, is_active, created_at, updated_at, score) | |
| VALUES (10002, 'z@z', 'z', true, NOW(), NOW(), 3) | |
| ON CONFLICT (id) DO NOTHING; | |
| -- DELETE with subquery | |
| DELETE FROM probe_users WHERE id IN (SELECT id FROM probe_users WHERE score > 30000) RETURNING id; | |
| -- UPDATE with subquery | |
| UPDATE probe_users SET score = score + 1 WHERE id IN (SELECT id FROM probe_users WHERE is_active) RETURNING id; | |
| -- ===== Transactions / savepoints (Django atomic, Hibernate) ===== | |
| SELECT '## Transactions' AS section; | |
| BEGIN; | |
| SAVEPOINT sp1; | |
| INSERT INTO probe_users(id, email, name, is_active, created_at, updated_at, score) | |
| VALUES (20001, 'a@a', 'a', true, NOW(), NOW(), 0); | |
| ROLLBACK TO SAVEPOINT sp1; | |
| COMMIT; | |
| -- Read-only / serializable | |
| BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY; | |
| SELECT COUNT(*) FROM probe_users; | |
| COMMIT; | |
| BEGIN ISOLATION LEVEL REPEATABLE READ; | |
| SELECT COUNT(*) FROM probe_users; | |
| COMMIT; | |
| -- SELECT FOR UPDATE (every queue-style app, EF Core .Lock) | |
| BEGIN; | |
| SELECT * FROM probe_users WHERE id = 1 FOR UPDATE; | |
| COMMIT; | |
| -- ===== prepared statements (every JDBC / psycopg2 / npgsql binding) ===== | |
| SELECT '## Prepared statements' AS section; | |
| PREPARE q1(BIGINT) AS SELECT * FROM probe_users WHERE id = $1; | |
| EXECUTE q1(42); | |
| PREPARE q2(TEXT) AS SELECT * FROM probe_users WHERE name ILIKE $1; | |
| EXECUTE q2('%name 42%'); | |
| PREPARE q3(BIGINT, TIMESTAMP) AS | |
| SELECT * FROM probe_users WHERE id > $1 AND created_at > $2; | |
| EXECUTE q3(0, '2024-01-01'); | |
| -- ===== Catalog introspection (ORMs ALL do this on startup) ===== | |
| SELECT '## Catalog introspection' AS section; | |
| -- Django: connection.introspection.get_table_description | |
| SELECT a.attname, format_type(a.atttypid, a.atttypmod), a.attnotnull | |
| FROM pg_attribute a WHERE attrelid = 'probe_users'::regclass AND attnum > 0; | |
| -- Rails: ActiveRecord::Base.connection.indexes('probe_users') | |
| SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'probe_users'; | |
| -- "Is the table writable" — Django, Hibernate | |
| SELECT * FROM information_schema.columns WHERE table_name = 'probe_users' LIMIT 3; | |
| -- ===== Recursive CTE (any tree-structured data: comments, threads, org charts) ===== | |
| SELECT '## Recursive CTE' AS section; | |
| WITH RECURSIVE r AS ( | |
| SELECT id, name FROM probe_users WHERE id = 1 | |
| UNION ALL | |
| SELECT u.id, u.name FROM probe_users u JOIN r ON u.id = r.id + 1 WHERE u.id < 10 | |
| ) | |
| SELECT * FROM r; | |
| -- ===== Cleanup ===== | |
| DROP TABLE probe_users; | |
| SELECT ydb_query_exec('DROP TABLE IF EXISTS `probe/public/probe_users`'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Continuation probe: things we didn't reach because PG crashed on SAVEPOINT | |
| \set ON_ERROR_STOP 0 | |
| \set ECHO queries | |
| \timing on | |
| DROP TABLE IF EXISTS probe2; | |
| CREATE TABLE probe2 ( | |
| id BIGINT PRIMARY KEY, | |
| email TEXT NOT NULL, | |
| name TEXT, | |
| created_at TIMESTAMP NOT NULL | |
| ); | |
| INSERT INTO probe2 SELECT g, 'u'||g||'@x', 'n'||g, NOW() - (g||'m')::interval FROM generate_series(1, 100) g; | |
| -- Prepared statements: TIMESTAMP, JSONB, complex param types | |
| SELECT '## Prepared with various param types' AS section; | |
| PREPARE pt(BIGINT) AS SELECT * FROM probe2 WHERE id = $1; | |
| EXECUTE pt(42); | |
| EXECUTE pt(43); -- should reuse plan | |
| EXECUTE pt(44); -- 3rd execution — generic plan | |
| EXECUTE pt(45); | |
| EXECUTE pt(46); -- generic plan should kick in | |
| PREPARE pts(TIMESTAMP) AS SELECT id FROM probe2 WHERE created_at > $1; | |
| EXECUTE pts('2024-01-01'); | |
| PREPARE pti(BIGINT, BIGINT) AS SELECT * FROM probe2 WHERE id BETWEEN $1 AND $2; | |
| EXECUTE pti(10, 20); | |
| -- Catalog introspection (ORMs hit this on startup) | |
| SELECT '## Catalog introspection' AS section; | |
| SELECT a.attname, format_type(a.atttypid, a.atttypmod), a.attnotnull | |
| FROM pg_attribute a WHERE attrelid = 'probe2'::regclass AND attnum > 0; | |
| SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'probe2'; | |
| SELECT column_name, data_type, is_nullable | |
| FROM information_schema.columns WHERE table_name = 'probe2'; | |
| -- pg_constraint introspection (Django, Rails, Hibernate inspect this) | |
| SELECT '## pg_constraint introspection' AS section; | |
| SELECT conname, contype, pg_get_constraintdef(oid) FROM pg_constraint | |
| WHERE conrelid = 'probe2'::regclass; | |
| -- Recursive CTE (every tree-structured app — categories, comments, org charts) | |
| SELECT '## Recursive CTE' AS section; | |
| WITH RECURSIVE r AS ( | |
| SELECT id, name FROM probe2 WHERE id = 1 | |
| UNION ALL | |
| SELECT u.id, u.name FROM probe2 u JOIN r ON u.id = r.id + 1 WHERE u.id < 10 | |
| ) | |
| SELECT * FROM r; | |
| -- SELECT FOR UPDATE (queue patterns, lock-based workflows) | |
| SELECT '## SELECT FOR UPDATE' AS section; | |
| BEGIN; | |
| SELECT * FROM probe2 WHERE id = 1 FOR UPDATE; | |
| COMMIT; | |
| BEGIN; | |
| SELECT * FROM probe2 WHERE id = 2 FOR SHARE; | |
| COMMIT; | |
| BEGIN; | |
| SELECT * FROM probe2 WHERE id = 3 FOR UPDATE SKIP LOCKED; | |
| COMMIT; | |
| -- Isolation level changes (apps that need REPEATABLE READ / READ COMMITTED) | |
| SELECT '## Isolation levels' AS section; | |
| BEGIN ISOLATION LEVEL REPEATABLE READ; | |
| SELECT count(*) FROM probe2; | |
| COMMIT; | |
| BEGIN ISOLATION LEVEL READ COMMITTED; | |
| SELECT count(*) FROM probe2; | |
| COMMIT; | |
| BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY; | |
| SELECT count(*) FROM probe2; | |
| COMMIT; | |
| -- VACUUM / CLUSTER / ANALYZE | |
| SELECT '## Maintenance ops' AS section; | |
| VACUUM probe2; | |
| ANALYZE probe2; | |
| CLUSTER probe2; | |
| REINDEX TABLE probe2; | |
| -- LISTEN/NOTIFY (event-driven apps) | |
| SELECT '## LISTEN/NOTIFY' AS section; | |
| LISTEN ch_test; | |
| NOTIFY ch_test, 'hello'; | |
| UNLISTEN ch_test; | |
| -- LATERAL join (very common in correlated subqueries) | |
| SELECT '## LATERAL' AS section; | |
| EXPLAIN (VERBOSE, COSTS OFF) | |
| SELECT a.id, b.id AS bid | |
| FROM probe2 a | |
| LEFT JOIN LATERAL (SELECT id FROM probe2 WHERE id = a.id + 1 LIMIT 1) b ON true | |
| LIMIT 3; | |
| -- DISTINCT ON (Rails .distinct on, Django distinct(*fields)) | |
| SELECT '## DISTINCT ON' AS section; | |
| EXPLAIN (VERBOSE, COSTS OFF) | |
| SELECT DISTINCT ON (name) id, name FROM probe2 ORDER BY name, id LIMIT 5; | |
| -- UPDATE ... FROM (joinful update, ORM batched updates) | |
| SELECT '## UPDATE ... FROM' AS section; | |
| UPDATE probe2 a SET name = b.name FROM probe2 b WHERE a.id = b.id + 1 AND a.id < 10 RETURNING a.id; | |
| -- DELETE ... USING | |
| DELETE FROM probe2 a USING probe2 b WHERE a.id = b.id + 50 AND a.id > 80 RETURNING a.id; | |
| -- COPY FROM STDIN — Postgres-native bulk load idiom | |
| SELECT '## COPY FROM' AS section; | |
| COPY probe2(id, email, name, created_at) FROM STDIN; | |
| 9001 c1@x c1 2024-01-01 00:00:00 | |
| 9002 c2@x c2 2024-01-02 00:00:00 | |
| \. | |
| SELECT * FROM probe2 WHERE id IN (9001, 9002); | |
| DROP TABLE probe2; | |
| SELECT ydb_query_exec('DROP TABLE IF EXISTS `probe2/public/probe2`'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Positive-scope probe: minimal Rails-style CRUD that AVOIDS every known landmine. | |
| -- Goal: prove a non-empty subset of real workloads where ydb_fdw is functional. | |
| \set ON_ERROR_STOP 0 | |
| \set ECHO queries | |
| \timing on | |
| -- Schema with ONLY supported types (int/text/bool/timestamp/uuid/numeric/bytea) | |
| -- and NO partial indexes, NO trigger, NO check constraint, NO array, NO jsonb. | |
| DROP TABLE IF EXISTS orders_min; | |
| CREATE TABLE orders_min ( | |
| id BIGINT PRIMARY KEY, | |
| customer_id BIGINT NOT NULL, | |
| sku TEXT NOT NULL, | |
| qty INTEGER NOT NULL, | |
| price NUMERIC(12,2) NOT NULL, | |
| note TEXT, | |
| is_paid BOOLEAN NOT NULL, | |
| placed_at TIMESTAMP NOT NULL | |
| ); | |
| -- 10k rows: a "small but realistic" production table | |
| INSERT INTO orders_min(id, customer_id, sku, qty, price, note, is_paid, placed_at) | |
| SELECT g, | |
| (g % 500) + 1, | |
| 'SKU-' || (g % 200), | |
| (g % 5) + 1, | |
| ((g % 10000) + 100)::numeric / 100, | |
| CASE WHEN g % 7 = 0 THEN 'expedite' ELSE NULL END, | |
| (g % 3 = 0), | |
| NOW() - (g || ' minutes')::interval | |
| FROM generate_series(1, 10000) g; | |
| -- ===== Patterns that an admin app does ===== | |
| SELECT '## simple lookups (pushdown expected)' AS section; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM orders_min WHERE id = 1234; | |
| SELECT * FROM orders_min WHERE id = 1234; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM orders_min WHERE customer_id = 42 ORDER BY id LIMIT 20; | |
| SELECT count(*) FROM orders_min WHERE customer_id = 42; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT id, sku, price FROM orders_min WHERE is_paid = true AND price > 50 ORDER BY id LIMIT 10; | |
| -- ===== Pagination (most common admin pattern) ===== | |
| SELECT '## keyset pagination' AS section; | |
| EXPLAIN (VERBOSE, COSTS OFF) | |
| SELECT * FROM orders_min WHERE id > 5000 ORDER BY id LIMIT 50; | |
| -- ===== Aggregates a dashboard would do ===== | |
| SELECT '## dashboard aggregates' AS section; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM orders_min WHERE is_paid = true; | |
| SELECT count(*) FROM orders_min WHERE is_paid = true; | |
| EXPLAIN (VERBOSE, COSTS OFF) SELECT customer_id, count(*), sum(price) FROM orders_min GROUP BY customer_id LIMIT 5; | |
| SELECT customer_id, count(*), sum(price) FROM orders_min GROUP BY customer_id ORDER BY customer_id LIMIT 5; | |
| -- ===== Writes ===== | |
| SELECT '## writes' AS section; | |
| INSERT INTO orders_min VALUES (100001, 1, 'NEW', 1, 9.99, NULL, false, NOW()) RETURNING id; | |
| UPDATE orders_min SET is_paid = true WHERE id = 100001 RETURNING id, is_paid; | |
| DELETE FROM orders_min WHERE id = 100001 RETURNING id; | |
| -- Batched write (Rails/Django insert_all path) | |
| INSERT INTO orders_min | |
| SELECT g + 200000, (g % 100) + 1, 'BATCH', 1, 1.00, NULL, false, NOW() | |
| FROM generate_series(1, 100) g; | |
| SELECT count(*) FROM orders_min WHERE sku = 'BATCH'; | |
| DELETE FROM orders_min WHERE sku = 'BATCH'; | |
| -- ===== Plain transaction with COMMIT (no savepoints) — Django without atomic(savepoint=True), JDBC default ===== | |
| SELECT '## flat transaction (no savepoints)' AS section; | |
| BEGIN; | |
| UPDATE orders_min SET qty = qty + 1 WHERE id = 1; | |
| UPDATE orders_min SET qty = qty + 1 WHERE id = 2; | |
| COMMIT; | |
| BEGIN; | |
| UPDATE orders_min SET qty = qty + 10 WHERE id = 1; | |
| ROLLBACK; | |
| SELECT qty FROM orders_min WHERE id = 1; | |
| DROP TABLE orders_min; | |
| SELECT ydb_query_exec('DROP TABLE IF EXISTS `minimal/public/orders_min`'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from collections import defaultdict | |
| from pathlib import Path | |
| results = Path("/workdir/empirical/results") | |
| EXCLUDE = {"probe", "probe2", "minimal", "mastodon"} | |
| projects = sorted(d.name for d in results.iterdir() | |
| if d.is_dir() and (d / "errors.tsv").exists() and d.name not in EXCLUDE) | |
| cat_hits = defaultdict(set) | |
| for p in projects: | |
| with (results / p / "errors.tsv").open() as f: | |
| next(f, None) | |
| for line in f: | |
| parts = line.rstrip("\n").split("\t") | |
| if len(parts) < 4: | |
| continue | |
| cat = parts[1].split(":")[0] | |
| cat_hits[cat].add(p) | |
| print(f"Real projects analyzed: {len(projects)}") | |
| plist = ", ".join(projects) | |
| print(f"({plist})") | |
| print() | |
| H1, H2, H3 = "category", "projects_hit", "affected" | |
| print(f"{H1:<32}{H2:>14} {H3}") | |
| for c in sorted(cat_hits, key=lambda x: -len(cat_hits[x])): | |
| n = len(cat_hits[c]) | |
| pct = 100 * n / len(projects) | |
| pjs = ", ".join(sorted(cat_hits[c])) | |
| print(f"{c:<32}{n:>5}/{len(projects):<2} ({pct:>4.0f}%) {pjs[:80]}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Real projects analyzed: 15 | |
| (authelia, calcom, concourse, discourse, drone, gitlabhq, hydra, lemmy, listmonk, mattermost, miniflux, pagila, plausible, woodpecker, zitadel) | |
| category projects_hit affected | |
| OTHER 15/15 ( 100%) authelia, calcom, concourse, discourse, drone, gitlabhq, hydra, lemmy, listmonk, | |
| TYPE_UNKNOWN 13/15 ( 87%) authelia, calcom, concourse, discourse, drone, gitlabhq, hydra, listmonk, matter | |
| NO_ADD_CONSTRAINT 11/15 ( 73%) authelia, calcom, concourse, discourse, drone, hydra, lemmy, mattermost, plausib | |
| ALTER_COL_NOT_REDIRECTED 11/15 ( 73%) authelia, calcom, concourse, discourse, drone, hydra, lemmy, mattermost, plausib | |
| NO_FOREIGN_KEY 8/15 ( 53%) authelia, calcom, concourse, discourse, drone, lemmy, mattermost, plausible | |
| NO_EXTENSION 7/15 ( 47%) discourse, drone, gitlabhq, hydra, lemmy, listmonk, plausible | |
| NO_ON_CONFLICT 5/15 ( 33%) calcom, concourse, drone, lemmy, zitadel | |
| INDEX_TYPE_NOT_SUPPORTED 5/15 ( 33%) calcom, discourse, lemmy, mattermost, plausible | |
| NO_PARTIAL_INDEX 5/15 ( 33%) calcom, discourse, drone, mattermost, zitadel | |
| NO_RULES 3/15 ( 20%) calcom, drone, plausible | |
| NO_PG_FUNCTION 3/15 ( 20%) drone, hydra, pagila | |
| SYNTAX_ERROR 3/15 ( 20%) hydra, miniflux, plausible | |
| OBJECT_EXISTS 2/15 ( 13%) hydra, mattermost | |
| NO_IDENTITY 1/15 ( 7%) authelia | |
| NO_ENUM_TYPE 1/15 ( 7%) calcom | |
| NO_TRIGGERS 1/15 ( 7%) calcom | |
| SEQUENCE_ERROR 1/15 ( 7%) discourse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment