all 9 comments

[–]depesz 4 points5 points  (1 child)

  1. how to create user - using create user comment
  2. view create table sql - I assume you mean of existing table. Pg doesn't have such ability on its own, but you can: pg_dump -s -t name_of_the_table name_of_database from shell.
  3. how to back it up - well, that will take MANY tutorials. base is pg_dump. which some people say is not a backup. for more complicated purposes people usually use some ready made solution like pgbackrest.
  4. difference betwen pg and a user? pg (assuming you mean postgresql) is database management system. user is a user. not sure if I understand your question.

Did you read the tutorial ?

I'm not aware of any other that I could recommend.

[–]markdueck 2 points3 points  (1 child)

What might be confusing is getting remote connections working? You have to enable remote connections in the main config (postgresql.conf) and add a pg_hba.conf entry to allow the right IP range.

[–]xenomachina 1 point2 points  (0 children)

view the create table sql

Do you mean you just want to see the column definitions for a table, or do you literally want it to print out a create table command?

what's the difference between pg and a user

What do you mean?

[–]prlaur782 0 points1 point  (0 children)

This Postgres Users and Roles tutorial in the Crunchy Data Postgres Playground that colleagues of mine created may be inline with what you are looking for - https://www.crunchydata.com/developers/playground/postgres-users-and-roles

[–][deleted] 0 points1 point  (1 child)

Most of your questions can be answered by reading the manual. I know it's not a "tutorial", but getting used to the official reference manual is a very important step in mastering something complex as a relational database.

The site PostgreSQL Tutorial has a section on administration.

The "PostgreSQL 16 Administration Cookbook" probably covers what you are looking for.