Jak sprawdzić tabelę istnieje lub nie w PostgreSQL
SELECT 1 FROM information_schema.tables
WHERE table_schema = 'schema_name' AND table_name = 'table_name';
Foolish Falcon
SELECT 1 FROM information_schema.tables
WHERE table_schema = 'schema_name' AND table_name = 'table_name';
"SELECT EXISTS (SELECT FROM pg_tables WHERE schemaname = 'public' AND tablename = 'repair_service')"
SELECT EXISTS (
SELECT FROM pg_tables
WHERE schemaname = 'schema_name'
AND tablename = 'table_name'
);