Thanks shaypatel - here's step by step instructions to Find Table Creation Time in Azure PostgreSQL Flexible Server
- Set log_statement to DDL and log_min_duration_statement to 1000 in server parameters. (measured in milliseconds, so 1000 will log statements that take more than 1 second)
- In your Azure PostgreSQL Flexible Server, configure diagnostic settings to send "PostgreSQLLogs" to Azure Log Analytics
- Run a CREATE TABLE statement on your PostgreSQL server.
- Use this KQL query in Azure Log Analytics:
AzureDiagnostics
| where Resource =~ "your-resource-name"
| where Category == "PostgreSQLLogs"
| where TimeGenerated > ago(5m)
| where Message contains "CREATE TABLE"
| project TimeGenerated, Message
Note: Replace "your-resource-name" with your actual resource name. Adjust the time range in `ago(5m)` as needed. This will show the timestamp and details of the `CREATE TABLE` statements.