Skip to content

Commit

Permalink
Add PostgreSQL Check if Current User is Supperuser
Browse files Browse the repository at this point in the history
  • Loading branch information
ayomawdb authored Jan 24, 2021
1 parent daebeea commit 4b8dab5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions SQL Injection/PostgreSQL Injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [PostgreSQL List Password Hashes](#postgresql-list-password-hashes)
* [PostgreSQL List Database Administrator Accounts](#postgresql-list-database-administrator-accounts)
* [PostgreSQL List Privileges](#postgresql-list-privileges)
* [PostgreSQL Check if Current User is Supperuser](#postgresql-check-if-current-user-is-supperuser)
* [PostgreSQL database name](#postgresql-database-name)
* [PostgreSQL List databases](#postgresql-list-database)
* [PostgreSQL List tables](#postgresql-list-tables)
Expand Down Expand Up @@ -70,6 +71,14 @@ SELECT usename FROM pg_user WHERE usesuper IS TRUE
SELECT usename, usecreatedb, usesuper, usecatupd FROM pg_user
```

## PostgreSQL Check if Current User is Supperuser

```sql
SHOW is_superuser;
SELECT current_setting('is_superuser');
SELECT usesuper FROM pg_user WHERE usename = CURRENT_USER;
```

## PostgreSQL Database Name

```sql
Expand Down

0 comments on commit 4b8dab5

Please sign in to comment.