Skip to content

Commit 0ac56c2

Browse files
new guides
1 parent 67950e1 commit 0ac56c2

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

articles/postgresql/flexible-server/how-to-troubleshooting-guides.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,28 @@ To use troubleshooting guides, follow these steps:
6060

6161
5. Follow the step-by-step instructions provided by the guide. Pay close attention to the charts and data visualizations plotted within the troubleshooting steps, as they can help you identify any inaccuracies or anomalies. Use this information to effectively diagnose and resolve the problem at hand.
6262

63+
### Retrieving the Query Text
64+
65+
Due to privacy considerations, certain information such as query text and usernames may not be displayed within the Azure portal.
66+
To retrieve the query text, you will need to log in to your Azure Database for PostgreSQL - Flexible Server instance.
67+
Access the `azure_sys` database using the PostgreSQL client of your choice, where query store data is stored.
68+
Once connected, query the `query_store.query_texts_view view` to retrieve the desired query text.
69+
70+
In the example shown below, we utilize Azure Cloud Shell and the `psql` tool to accomplish this task:
71+
72+
:::image type="content" source="./media/how-to-troubleshooting-guides/retrieve-query-text.png" alt-text="Retrieving the Query Text":::
73+
74+
### Retrieving the Username
75+
76+
For privacy reasons, the Azure portal displays the role ID from the PostgreSQL metadata (pg_catalog) rather than the actual username.
77+
To retrieve the username, you can query the `pg_roles` view or use the query shown below in your PostgreSQL client of choice, such as Azure Cloud Shell and the `psql` tool:
78+
79+
```sql
80+
SELECT 'UserID'::regrole;
81+
```
82+
83+
:::image type="content" source="./media/how-to-troubleshooting-guides/retrieve-username.png" alt-text="Retrieving the Username":::
84+
6385

6486
## Next steps
6587

129 KB
Loading
83.4 KB
Loading

0 commit comments

Comments
 (0)