Cov txheej txheem:

Kuv yuav ua li cas thiaj tsim tau ib qho database schema hauv PostgreSQL?
Kuv yuav ua li cas thiaj tsim tau ib qho database schema hauv PostgreSQL?

Video: Kuv yuav ua li cas thiaj tsim tau ib qho database schema hauv PostgreSQL?

Video: Kuv yuav ua li cas thiaj tsim tau ib qho database schema hauv PostgreSQL?
Video: Cia ua ib zaj dab neeg karaoke 2024, Tej zaum
Anonim

PostgreSQL CREATE SCHEMA

  1. Ua ntej, qhia lub npe ntawm tus schema tom qab lub Tsim SCHEMA lo lus tseem ceeb. Cov schema lub npe yuav tsum yog tshwj xeeb hauv cov ntaub ntawv tam sim no.
  2. Thib ob, xaiv xaiv siv YOG TSIS MUAJ NTAU rau conditionally tsim qhov tshiab schema tsuas yog tsis muaj nyob.

Kuj nug, Kuv yuav ua li cas thiaj tsim tau ib qho schema hauv PostgreSQL?

Tsim schema nrog PostgreSQL UI:

  1. Qhib pgAdmin thiab txuas PostgreSQL mus rau lub server hauv zos.
  2. Nthuav cov databases los ntawm txhaj rau lub cim ntxiv.
  3. Koj tuaj yeem pom tias muaj peb lub databases.
  4. Nthuav cov database "javatpoint".
  5. Ntawm no, koj tuaj yeem pom "schemas".
  6. Ib tug schema yog tsim lub npe "myschema".

Public schema hauv PostgreSQL yog dab tsi? Thaum pib database creation, lub tshiab tsim Postgresql database muaj xws li ib tug pre-txhais schema npe " pej xeem ”. Nws yog ib schema zoo li lwm yam, tab sis tib lo lus kuj tseem siv los ua lo lus tseem ceeb uas txhais tau tias "tag nrho cov neeg siv" hauv cov ntsiab lus uas txwv tsis pub siv lub luag haujlwm lub npe, xws li

Tsis tas li ntawd, database schema PostgreSQL yog dab tsi?

Hauv PostgreSQL , a schema yog lub npe chaw uas muaj npe database cov khoom xws li cov ntxhuav, views, indexes, cov ntaub ntawv hom, functions, thiab cov tswv. A database tuaj yeem muaj ib lossis ntau yam schemas thaum txhua tus schema belongs rau ib leeg xwb database . Ob schemas tuaj yeem muaj cov khoom sib txawv uas qhia tib lub npe.

Yuav ua li cas koj tsim ib schema hauv pgAdmin 4?

A. Tsim ib lub tswv yim tshiab

  1. Qhib pgAdmin 4.
  2. Ob-nias ntawm tus neeg rau zaub mov ntawd qhib kev sib txuas rau nws.
  3. Nthuav cov npe Databases.
  4. Txoj cai-nias rau ntawm daim ntawv teev npe, thiab xaiv Tsim> Database.
  5. Nyob rau hauv Tsim - Database dialog, teem lub Database rau Lesson3db, thiab los ntawm tus tswv daim ntawv teev npe, xaiv tus neeg siv lub npe postgres.

Pom zoo: