Languages
[Edit]
EN

PostgreSQL - find all tables with specific column names

0 points
Created by:
Haris65
536

In this article, we would like to show you how to find all tables with specific column names in PostgreSQL

Quick solution:

Practical example

Edit

Let's say we have a database named dirask that contains users table and admins table, both with the following columns:

  • id
  • name
  • surname
  • email

and locations table with columns:

  • id
  • address

Example 1

Edit

In this example, we will display all the tables from dirask database that contains name OR surname columns.

Query:

Output:

PostgreSQL - find all tables with specific column names
Results - HeidiSQL

Example 2

Edit

In this example, we will display all the tables from dirask database that contain id column.

Query:

Output:

PostgreSQL - find all tables with specific column name - result
Results - HeidiSQL
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join