H
H
hbrmdc2015-12-18 07:18:29
PostgreSQL
hbrmdc, 2015-12-18 07:18:29

How to work with users in Postgres?

Before, I used databases of BaaS services (Backend as a Service) - Parse, Backendless, Firebase - everything that concerns site users is already prepared there.
How to deal with site users in their own database?
1. Is it just a separate table containing columns named "login", "password" and so on, or does it need to be implemented in some specific way?
2. What about tokens? Should they be stored in the database or is it generally done on the server and has nothing to do with the database?
3. What about owner policies? Are there any special approaches for this, or should I just create an additional column in each table that will contain the user id and be a Foreign key?
If you know of any articles on this topic - I will be grateful for the link! It is possible in English. I would google this question, but I don’t know how to formulate a query in Google - I get to articles and documentation about Database users and so on. I think so, this is not what I need.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2015-12-18
@hbrmdc

1 yes
2 can be stored both in files and in database
3
such things are solved not at the subd level, but at the backend level

Are there any special approaches for this, or should I just create an additional column in each table that will contain the user id and be a Foreign key?
they do it most of the time

B
Boris Benkovsky, 2015-12-18
@benbor

To get started, (and since you're asking these kinds of questions, you're just getting started) try to find a ready-made popular solution for your framework. Usually, ready, not always ideal for the task. But it will be better than you inventing bicycles from scratch.
You will also understand how "smart" people do. And after that, you will be able to make an "ideal" solution for your task, if suddenly, the finished one does not suit you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question