tag:blogger.com,1999:blog-8085342449633067864.post9152630257767974773..comments2024-03-25T11:28:05.884-04:00Comments on Code 18: Vérifier si une table existe dans PostgresInfinite Loophttp://www.blogger.com/profile/14525518280316303728noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-8085342449633067864.post-27839839234125654492012-09-21T17:16:47.599-04:002012-09-21T17:16:47.599-04:00Bonjour !!
plus simplement :
SELECT table_name FR...Bonjour !!<br />plus simplement :<br /><br />SELECT table_name FROM information_schema.tables WHERE table_schema='nom_schema' AND table_name='nom_table'<br /><br />même chose pour l'existance d'un schema :<br /><br />SELECT table_schema FROM information_schema.tables WHERE table_schema='nom_schema' GROUP BY table_schema<br /><br />ou une colonne :<br /><br />SELECT column_name FROM information_schema.columns WHERE table_schema='nom_schema' AND table_name='nom_table' AND column_name='nom_colonne'Pierricknoreply@blogger.com