diff --git a/docs/PostgreSQL/2026-02-17-commandes-utiles.md b/docs/PostgreSQL/2026-02-17-commandes-utiles.md new file mode 100644 index 0000000..dff6c5d --- /dev/null +++ b/docs/PostgreSQL/2026-02-17-commandes-utiles.md @@ -0,0 +1,15 @@ +--- +title: "PostgreSQL : Commandes et requêtes utiles" +author: + - JF +date: 2026-02-17 +--- +## Ne lister que les colonnes d'une table +```sql +\set TABLE_NAME 'ma_table' +SELECT column_name FROM information_schema.columns where table_name = :'TABLE_NAME'; +``` +Afficher toutes les tables et leur colonnes avec un début de nom de table : +```sql +SELECT table_name, column_name FROM information_schema.columns where table_name like debutnom%; +``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 537f75f..7b357c8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,6 +24,8 @@ nav: - Linux: - "Linux/2025-05-20-bash-life.md" - "Linux/2019-07-09-manipulations-LVM.md" + - PostgreSQL: + - "PostgreSQL/2026-02-17-commandes-utiles.md" - About: about.md theme: readthedocs