Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Asked
Modified 3 days ago
Viewed 21 times
0

postgres database objects are represented as files, or directories on the filesystem level (inside $PGDATA/base/).

I can see that i.e. for database, table.

What is the presentation of a postgres role/user on the fs level?

This can be useful in order to see when a user was created or modified which is what I want to do atm.

for this I neither can see any function with such kind of information.

1 Answer 1

1

Database objects are not represented as files in PostgreSQL.

True, each table has one or more data files, but a table is more than these files: it is defined by entries in metadata tables like pg_class, pg_attribute, pg_attrdef, pg_type (to name only a few).

A PostgreSQL role doesn't have data files, since it doesn't contain any data. It only consists of an entry in pg_authid. Now PostgreSQL doesn't store the time when a table row was created, so there is no way to find out when a role was created.

Your best bet is to use an event trigger that writes an entry into a logging table whenever a role is created.

1
  • thx for claryfying
    vrms
    –  vrms
    2025-10-13 13:01:39 +00:00
    Commented Oct 13 at 13:01

Your Answer

Reminder: Answers generated by AI tools are not allowed due to Database Administrators Stack Exchange's artificial intelligence policy

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.