session_user id

Поиск
Список
Период
Сортировка
От Keith Worthington
Тема session_user id
Дата
Msg-id 20050224182645.M35953@narrowpathinc.com
обсуждение исходный текст
Список pgsql-novice
Hi All,

I have the following table that is used to log the receipt of an item.  As you
can see the receipt_timestamp uses a default of now.  I would like to add a
column with a default of the session user.  In order to avoid column length
sizing issues and keep the table small I thought that I could store the
session_user id ( int4 ) instead of the text name ( varchar(?) ).  How can
this be done?

CREATE TABLE purchase_order.tbl_receiving
(
  po_number int4 NOT NULL,
  po_line int2 NOT NULL,
  receipt_number serial NOT NULL,
  quantity float4 NOT NULL,
  receipt_timestamp timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6)
with time zone,
  CONSTRAINT tbl_receiving_pkey PRIMARY KEY (po_number, po_line, receipt_number),
  CONSTRAINT tbl_receiving_fkey1 FOREIGN KEY (po_number, po_line) REFERENCES
purchase_order.tbl_line_item (po_number, po_line) ON UPDATE CASCADE ON DELETE
RESTRICT
)

Kind Regards,
Keith

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

Предыдущее
От:
Дата:
Сообщение: Re: shutdown postmaster question
Следующее
От: George Weaver
Дата:
Сообщение: Re: shutdown postmaster question