Cov txheej txheem:

Yuav ua li cas koj tsim ib tug nyeem nkaus xwb nyob rau hauv PostgreSQL?
Yuav ua li cas koj tsim ib tug nyeem nkaus xwb nyob rau hauv PostgreSQL?

Video: Yuav ua li cas koj tsim ib tug nyeem nkaus xwb nyob rau hauv PostgreSQL?

Video: Yuav ua li cas koj tsim ib tug nyeem nkaus xwb nyob rau hauv PostgreSQL?
Video: Dab ntxwg nyoos yog leej twg ...zaj no zoo heev. 2024, Hlis ntuj nqeg
Anonim

PostgreSQL - Yuav ua li cas los tsim tus neeg siv nyeem nkaus xwb?

  1. Rau tsim ib new tus neeg siv hauv PostgreSQL : Tsim tus neeg siv username NROG PASSWORD 'koj_password';
  2. PAUB CONNECT nkag mus: GRANT CONNECT RAU DATABASE database_name TO username;
  3. Tom qab ntawd GRANT SIV on schema: GRANT SIV RAU SCHEMA schema_name TO username;
  4. PAUB SELECT. Grant SELECT rau ib lub rooj tshwj xeeb:

Ib sab ntawm qhov no, kuv yuav tso cai txuas cov cai rau cov neeg siv hauv PostgreSQL li cas?

Nov yog qee cov lus hais kom tso cai nkag mus rau tus neeg siv PostgreSQL:

  1. Muab CONNECT rau database:
  2. Grant SIV ntawm schema:
  3. Muab rau txhua lub rooj rau DML nqe lus: SELECT, INSERT, Hloov tshiab, DELETE:
  4. Muab tag nrho cov cai ntawm txhua lub rooj hauv schema:
  5. Muab tag nrho cov cai ntawm txhua qhov sib lawv liag hauv schema:

Ib qho tseem yuav nug, dab tsi yog kev pab nyiaj pub dawb hauv PostgreSQL? PAUB SIV RAU SCHEMA schema rau lub luag haujlwm; Siv : Rau schemas, tso cai rau kev nkag mus rau cov khoom uas muaj nyob rau hauv cov txheej txheem teev tseg (piv txwv tias cov khoom 'tus kheej cov cai yuav tsum tau ua raws li). Qhov tseem ceeb, qhov no tso cai rau tus neeg txais txiaj ntsig los "saib" cov khoom hauv schema.

Tib neeg kuj nug, Kuv yuav tsim tus neeg siv tshiab ntawm pgAdmin li cas?

Tsim a neeg siv nrog pgAdmin . Txuas rau koj qhov PostgreSQL server piv txwv siv pgAdmin > right-click rau 'Group Roles' thiab xaiv ' Tshiab Pawg Role'. Muab lub luag haujlwm rau lub npe piav qhia> nyem 'OK'.

Yuav ua li cas kuv muab tag nrho cov ntxhuav nyob rau hauv ib tug schema?

Yuav Ua Li Cas: Muab cov cai ntawm txhua lub rooj hauv txhua qhov schemas hauv a

  1. Tau txais cov npe ntawm schemas hauv koj cov ntaub ntawv. Khiav qhov SHOW SCHEMAS cov lus txib kom khaws tag nrho cov schemas hauv koj cov ntaub ntawv; e.g., dbtest: Qhia SCHEMAS hauv DATABASE dbtest;
  2. Muab cov cai. Muab cov cai tshwj xeeb ntawm txhua lub rooj hauv txhua qhov schemas hauv cov ntaub ntawv.

Pom zoo: