Merge pull request 'Ajout de la section PostgreSQL (il y a prescription :D)' (#20) from psql into main
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #20
This commit was merged in pull request #20.
This commit is contained in:
15
docs/PostgreSQL/2026-02-17-commandes-utiles.md
Normal file
15
docs/PostgreSQL/2026-02-17-commandes-utiles.md
Normal file
@@ -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%;
|
||||||
|
```
|
||||||
@@ -24,6 +24,8 @@ nav:
|
|||||||
- Linux:
|
- Linux:
|
||||||
- "Linux/2025-05-20-bash-life.md"
|
- "Linux/2025-05-20-bash-life.md"
|
||||||
- "Linux/2019-07-09-manipulations-LVM.md"
|
- "Linux/2019-07-09-manipulations-LVM.md"
|
||||||
|
- PostgreSQL:
|
||||||
|
- "PostgreSQL/2026-02-17-commandes-utiles.md"
|
||||||
- About: about.md
|
- About: about.md
|
||||||
theme: readthedocs
|
theme: readthedocs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user