# I need to enter the postgres server time in a transaction group table

**URL:** <https://forum.inductiveautomation.com/t/i-need-to-enter-the-postgres-server-time-in-a-transaction-group-table/63886>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [September 8, 2022, 3:33pm UTC](https://forum.inductiveautomation.com/t/i-need-to-enter-the-postgres-server-time-in-a-transaction-group-table/63886 "2022-09-08T15:33:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Armengol\_C](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@Francisco\_Armengol\_C](https://forum.inductiveautomation.com/u/Francisco_Armengol_C)\
**Post date:** [September 8, 2022, 3:33pm UTC](https://forum.inductiveautomation.com/t/i-need-to-enter-the-postgres-server-time-in-a-transaction-group-table/63886/1 "2022-09-08T15:33:44Z")

</div>

Hello, I am filling a postgres table and I have a field called “moment” type timestamp  
It has to hold the date and time of the postgres database server, _ **not the date and time of ignition Server** _.  
Using SQL I would do it like this: insert into TABLE (moment,temperature)values(‘3.15’ , now())  
But I don’t know how to do it with a transaction group which is what I need to use

Can someone help me?

Thank you

---

<div class="post-metadata">

**Author:** ![Francisco\_Armengol\_C](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@Francisco\_Armengol\_C](https://forum.inductiveautomation.com/u/Francisco_Armengol_C)\
**Post date:** [September 8, 2022, 3:35pm UTC](https://forum.inductiveautomation.com/t/i-need-to-enter-the-postgres-server-time-in-a-transaction-group-table/63886/2 "2022-09-08T15:35:36Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/628dd990059b506e1ed48481f4c859b7d558e27c.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 8, 2022, 4:01pm UTC](https://forum.inductiveautomation.com/t/i-need-to-enter-the-postgres-server-time-in-a-transaction-group-table/63886/3 "2022-09-08T16:01:00Z")

</div>

2 options:

- An expression item querying the db for the current timestamp. This makes two round trips to the db, which is not ideal.  

- Adjust the setting of the momento column to have the default value of current\_timestamp (using the db software of your choice). No extra trips to the db

```sql
alter table table_name
    alter column t_stamp set default current_timestamp;

```

Note: I think you can use either `current_timestamp` or `now()`. Both work on the version of postgres I’m using.
