DDL with Reference on them.

Поиск
Список
Период
Сортировка
От Michael Gould
Тема DDL with Reference on them.
Дата
Msg-id 6164324f1fba183171c554012fc1ab85@intermodalsoftwaresolutions.net
обсуждение исходный текст
Ответ на Re: VMWare file system / database corruption  (Vick Khera <vivek@khera.org>)
Ответы Re: DDL with Reference on them.  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
I have a question about using Reference.  I have several tables that are
defined such as below

CREATE TABLE iss.accessor (
  loaddtlid UUID NOT NULL ,
  seqno SMALLINT NOT NULL ,
  billable VARCHAR(1) DEFAULT 'N' CHECK(billable IN ('N','Y')) NOT NULL ,
  payind VARCHAR(1) DEFAULT 'P' CHECK(payind IN ('P','F')) NOT NULL ,
  code UUID REFERENCE accessorcodes (code) ,
  description CITEXT ,
  ref CITEXT ,
  tractororcarrierflag VARCHAR(1) DEFAULT 'T' CHECK(tractororcarrierflag IN
('T','C')) NOT NULL ,
  tractororcarriernoid UUID ,
  tractorpct DECIMAL(6,4) DEFAULT 0 CHECK(tractorpct BETWEEN 0 AND 1) NOT
NULL ,
  charge DECIMAL(7,2) DEFAULT 0 ,
  type VARCHAR(1) DEFAULT 'N' CHECK(type IN ('N','V','D','R','A','S')) NOT
NULL ,
  checkdate DATE ,
  checkno CITEXT ,
  processed VARCHAR(1) DEFAULT 'N' CHECK(processed IN ('N','Y')) NOT NULL ,
  itemflag VARCHAR(1) DEFAULT 'N' CHECK(itemflag IN ('N','Y')) NOT NULL ,
  tractorterminalid UUID REFERENCES terminal (terminalid) ,
  cost DECIMAL(7,2) DEFAULT 0 ,
  createdatetime TIMESTAMP ,
  createuser CITEXT ,
  editdatetime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ,
  edituser CITEXT DEFAULT CURRENT_USER
)

As you can see there are a few columns which reference back to another
table.  What I need to know is how does Postgres work with these columns.
Can I insert or update a row if those columns are null or are they required
to have a non-null value in order for the row to be inserted or saved?

Best Regards

Michael Gould



В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: VMWare file system / database corruption
Следующее
От: "Scot Kreienkamp"
Дата:
Сообщение: Re: VMWare file system / database corruption