# Database's Data Model?

**URL:** https://meta.discourse.org/t/databases-data-model/93668
**Category:** Support
**Created:** [August 1, 2018, 6:02pm UTC](https://meta.discourse.org/t/databases-data-model/93668 "2018-08-01T18:02:54Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [August 2, 2018, 7:01am UTC](https://meta.discourse.org/t/databases-data-model/93668/4 "2018-08-02T07:01:44Z")

</div>

I often prefer the command line.

```plaintext
cd /var/discourse 
sudo ./launcher enter app

```

enter password, then  
`sudo -u postgres psql discourse`

Then, _being very careful_ I run queries like

```plaintext
SELECT table_name, table_type 
FROM INFORMATION_SCHEMA.TABLES 
WHERE table_catalog = 'discourse' 
AND table_schema = 'public'; 

```

\* currently 138 rows

```plaintext
SELECT table_name, column_name, data_type, column_default, character_maximum_length 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE table_catalog = 'discourse' 
AND table_schema = 'public' 
ORDER BY table_name;

```

\* currently 1258 rows, a good idea to have a `WHERE table_name = '{{some table name here}}'` or a `LIMIT` in that query.

---

_[View the full topic](https://meta.discourse.org/t/databases-data-model/93668)._
