Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set appname for pg_stat_activity entry #168

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

steve-chavez
Copy link
Member

This is so select * from pg_stat_activity where application_name like '%pg_net%'; can work as usual.

It's only a refactor as the 1000 milliseconds is harcoded on worker.c anyway.
This is so `select * from pg_stat_activity where application_name like '%pg_net%';`
can work as usual.
Copy link

@za-arthur za-arthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks good to me.
It is possible to get status of the worker by checking backend_type:

=# select datname, application_name, state, backend_type from pg_stat_activity where backend_type like 'pg_net%';
   datname    │ application_name │ state  │     backend_type
──────────────┼──────────────────┼────────┼──────────────────────
 pre_existing │                  │ (null) │ pg_net 0.12.0 worker

But I suppose altering application_name could make it more friendlier to users.

@steve-chavez steve-chavez merged commit 05dd984 into supabase:master Nov 11, 2024
7 checks passed
@steve-chavez
Copy link
Member Author

But I suppose altering application_name could make it more friendlier to users.

Yes, this was just a nicety. I noticed pg_cron does the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants