0

I have a table that looks like this:

CREATE TABLE tabley(
   log          text, -- something like this you get the point
   created      timestamptz NOT NULL DEFAULT NOW()
)

And I want to let a postgres user INSERT their own arbitrary log but I want to make sure they are not allowed to set their own arbitrary created. Is there any clean way to enforce this?

2
  • I think following will help you - stackoverflow.com/questions/15411735/… Commented Dec 11, 2021 at 4:17
  • @Maxqueue that's an interesting idea, using an on-insert trigger to set the created field so that it can't be overridden Commented Dec 11, 2021 at 4:48

0

Your Answer

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.