Create a function that updates the record with and timestamps
От
Chris Barnes
Тема
Create a function that updates the record with and timestamps
Дата
Msg-id
BLU149-W2F208AB63B1569DDB94C9D4270@phx.gbl
Список
Дерево обсуждения
Create a function that updates the record with and timestamps Chris Barnes <compuguruchrisbarnes@hotmail.com>
Re: Create a function that updates the record with and timestamps "A. Kretschmer" <andreas.kretschmer@schollglas.com>
Re: Create a function that updates the record with and
timestamps Chris Barnes <compuguruchrisbarnes@hotmail.com>
Re: Create a function that updates the record with and timestamps Adrian Klaver <adrian.klaver@gmail.com>
I would like to have postgres update the last_modified column with the current_date on an update of the record.
I am not sure if there is a very simple way of doing this?
Or, do I need to create a function and a trigger to call the row and update with new data and set the last_modified to current_date?
Here is the table.
CREATE TABLE price.price_table (
PRICE_DATE DATE,
ID VARCHAR(13),
OPENING NUMERIC(18,6),
CLOSING NUMERIC(18,6),
HIGHEST NUMERIC(18,6),
LOWEST NUMERIC(18,6),
VOLUME BIGINT,
LAST_MODIFIED TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT current_date,
CONSTRAINT PK_PRICE PRIMARY KEY (PRICE_DATE,ID));
Any help would be appreciated.
Cheers,
Chris
Stay in touch. Get Messenger on your phone now.
I am not sure if there is a very simple way of doing this?
Or, do I need to create a function and a trigger to call the row and update with new data and set the last_modified to current_date?
Here is the table.
CREATE TABLE price.price_table (
PRICE_DATE DATE,
ID VARCHAR(13),
OPENING NUMERIC(18,6),
CLOSING NUMERIC(18,6),
HIGHEST NUMERIC(18,6),
LOWEST NUMERIC(18,6),
VOLUME BIGINT,
LAST_MODIFIED TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT current_date,
CONSTRAINT PK_PRICE PRIMARY KEY (PRICE_DATE,ID));
Any help would be appreciated.
Cheers,
Chris
Stay in touch. Get Messenger on your phone now.
В списке pgsql-general по дате отправления