{"id":"6fe773ea1394143e","repo":"drizzle-team/drizzle-orm","slug":"you-can-t-specify-public-as-schema-name-postgre","errorCode":null,"errorMessage":"You can't specify 'public' as schema name. Postgres is using public schema by default. If you want to use 'public' schema, just use GelTable() instead of creating a schema","messagePattern":"You can't specify 'public' as schema name\\. Postgres is using public schema by default\\. If you want to use 'public' schema, just use GelTable\\(\\) instead of creating a schema","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-orm/src/gel-core/schema.ts","lineNumber":50,"sourceCode":"\t\treturn gelSequenceWithSchema(name, options, this.schemaName);\n\t});\n\n\tgetSQL(): SQL {\n\t\treturn new SQL([sql.identifier(this.schemaName)]);\n\t}\n\n\tshouldOmitSQLParens(): boolean {\n\t\treturn true;\n\t}\n}\n\nexport function isGelSchema(obj: unknown): obj is GelSchema {\n\treturn is(obj, GelSchema);\n}\n\nexport function gelSchema<T extends string>(name: T) {\n\tif (name === 'public') {\n\t\tthrow new Error(\n\t\t\t`You can't specify 'public' as schema name. Postgres is using public schema by default. If you want to use 'public' schema, just use GelTable() instead of creating a schema`,\n\t\t);\n\t}\n\n\treturn new GelSchema(name);\n}\n","sourceCodeStart":32,"sourceCodeEnd":57,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-orm/src/gel-core/schema.ts#L32-L57","documentation":"Error \"You can't specify 'public' as schema name. Postgres is using public schema by default. If you want to use 'public' schema, just use GelTable() instead of creating a schema\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Creating gelSchema('public') — 'public' is reserved because Gel uses it by default.","commonSituations":"Porting pgSchema-based code to Gel; explicitly naming the default schema instead of using gelTable().","solutions":["Use gelTable() directly instead of gelSchema('public').table(...) for tables in the default public schema.","Rename the schema to something other than 'public' if a custom schema is intended."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}