Re: GENERATE AS

Поиск
Список
Период
Сортировка
От Ron
Тема Re: GENERATE AS
Дата
Msg-id 328b8fb1-08e8-2c74-a2b8-878ad5e9f9a4@gmail.com
обсуждение исходный текст
Ответ на GENERATE AS  ("Wetmore, Matthew (CTR)" <Matthew.Wetmore@express-scripts.com>)
Ответы Re: GENERATE AS  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-admin
On 6/22/23 15:00, Wetmore, Matthew (CTR) wrote:
@font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink {mso-style-priority:99; color:#0563C1; text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:#954F72; text-decoration:underline;}span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri",sans-serif; color:windowtext;}.MsoChpDefault {mso-style-type:export-only; font-family:"Calibri",sans-serif;}div.WordSection1 {page:WordSection1;}

Hi, I have this issue and now I’m just wasting time. Can you tell me what I’m doing wrong?

 

I’d like to subtract a column timestamp hour from current hour to give me hours elapased.

 

How do I do this easily?

 

I think I’ve tried every combination of types and casting.

 

Thanks in advance.

---------------------------

 

1. ALTER TABLE matt

               add column matt_time timestamp with time zone default current_timestamp;


Besides what Ilya and David mentioned, CURRENT_TIMESTAMP is based on when the transaction started.  You might have wanted clock_timestamp().

--
Born in Arizona, moved to Babylonia.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: GENERATE AS
Следующее
От: Ron
Дата:
Сообщение: Re: GENERATE AS