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 Commented Oct 13 at 13:01

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.