drizzle-team/drizzle-orm · error · Error

You can't specify 'public' as schema name. Postgres is using

Error message

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

What it means

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.

Source

Thrown at drizzle-orm/src/gel-core/schema.ts:50

		return gelSequenceWithSchema(name, options, this.schemaName);
	});

	getSQL(): SQL {
		return new SQL([sql.identifier(this.schemaName)]);
	}

	shouldOmitSQLParens(): boolean {
		return true;
	}
}

export function isGelSchema(obj: unknown): obj is GelSchema {
	return is(obj, GelSchema);
}

export function gelSchema<T extends string>(name: T) {
	if (name === 'public') {
		throw new 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`,
		);
	}

	return new GelSchema(name);
}

View on GitHub (pinned to b7862528fd)

Solutions

  1. Use gelTable() directly instead of gelSchema('public').table(...) for tables in the default public schema.
  2. Rename the schema to something other than 'public' if a custom schema is intended.

When it happens

Trigger: Creating gelSchema('public') — 'public' is reserved because Gel uses it by default.

Common situations: Porting pgSchema-based code to Gel; explicitly naming the default schema instead of using gelTable().


AI-assisted analysis of drizzle-team/drizzle-orm@b7862528fd (2026-08-03). Data as JSON: /data/errors/6fe773ea1394143e.json. Report an issue: GitHub.