public inbox for [email protected]  
help / color / mirror / Atom feed
From: Subramanian,Ramachandran <[email protected]>
To: Laurenz Albe <[email protected]>
To: [email protected] <[email protected]>
Subject: AW: SQL - How to iterate with delay in a loop
Date: Fri, 6 Mar 2026 18:24:01 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

Thank you so much. That worked perfectly.  馃槉 

LG

Ram


id_column |       saved_ts_no_tz       |       saved_ts_with_tz        | saved_date |   saved_time
-----------+----------------------------+-------------------------------+------------+-----------------
        20 | 2026-03-06 19:22:18.992382 | 2026-03-06 19:22:18.992384+01 | 2026-03-06 | 19:22:18.992385
        21 | 2026-03-06 19:22:19.993481 | 2026-03-06 19:22:19.993484+01 | 2026-03-06 | 19:22:19.993485
        22 | 2026-03-06 19:22:20.99458  | 2026-03-06 19:22:20.994583+01 | 2026-03-06 | 19:22:20.994584
        23 | 2026-03-06 19:22:21.994803 | 2026-03-06 19:22:21.994806+01 | 2026-03-06 | 19:22:21.994806
        24 | 2026-03-06 19:22:22.995918 | 2026-03-06 19:22:22.99592+01  | 2026-03-06 | 19:22:22.995921
        25 | 2026-03-06 19:22:23.997049 | 2026-03-06 19:22:23.997051+01 | 2026-03-06 | 19:22:23.997052
        26 | 2026-03-06 19:22:24.997807 | 2026-03-06 19:22:24.997809+01 | 2026-03-06 | 19:22:24.997809
        27 | 2026-03-06 19:22:25.998923 | 2026-03-06 19:22:25.998926+01 | 2026-03-06 | 19:22:25.998927



Freundliche Gr眉脽e

i. A. Ramachandran Subramanian
Zentralbereich Informationstechnologie

Alte Leipziger Lebensversicherung a.G.


Hallesche Krankenversicherung a.G.







Alte Leipziger Lebensversicherung a.G., Alte Leipziger-Platz 1, 61440 Oberursel
Vors. des Aufsichtsrats: Dr. Walter Botermann 路 Vorstand: Christoph Bohn (Vors.), Dr. J眉rgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcsek
Sitz Oberursel (Taunus) 路 Rechtsform VVaG 路 Amtsgericht Bad Homburg v. d. H. HRB 1583 路 USt.-IdNr. DE 114106814





 
Hallesche Krankenversicherung a.G.,  L枚ffelstra脽e 34-38, 70597 Stuttgart
Vors. des Aufsichtsrats: Dr. Walter Botermann 路 Vorstand: Christoph Bohn (Vors.), Dr. J眉rgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Mayer, Christian Pape,
Wiltrud Pekarek, Udo Wilcsek
Sitz Stuttgart 路 Rechtsform VVaG 路 Amtsgericht Stuttgart HRB 2686 路 USt.-IdNr. DE 147802285
Beitr盲ge zu privaten Kranken- und Pflegekrankenversicherungen unterliegen nicht der Versicherungsteuer (搂 4 Nr. 5 VersStG) 路 Versicherungsleistungen sowie Ums盲tze aus Versicherungsvertreter-/Maklert盲tigkeiten sind umsatzsteuerfrei
 



 
Die Pflichtangaben der ALH Gruppe gem盲脽 搂 35a GmbHG bzw. 搂 80 AktG finden Sie hier: https://www.alte-leipziger.de/impressum 





______________________

ALH Gruppe
Alte Leipziger-Platz 1, 61440 Oberursel
Tel.: +49 (6171) 66-4882
Fax: +49 (6171) 66-800-4882
E-Mail: [email protected]
www.alte-leipziger.de
www.hallesche.de



-----Urspr眉ngliche Nachricht-----
Von: Laurenz Albe <[email protected]> 
Gesendet: Freitag, 6. M盲rz 2026 14:21
An: Subramanian,Ramachandran IT-md-db <[email protected]>; [email protected]
Betreff: Re: SQL - How to iterate with delay in a loop

On Fri, 2026-03-06 at 12:07 +0000, Subramanian,Ramachandran wrote:
> I am trying to insert some rows into a table with a delay between each insert.
> I have a simple table with a ID column and some Date-Time columns.
> 聽
> The first two inserts work as expected and insert two rows, each one second apart.
> 聽
> However the do loop inserts 25 more rows, with the same timestamp.

Use clock_timestamp()::time instead of current_time.
current_time returns the same value for each call in the same database transaction.  Think of it as "transaction start time".

Yours,
Laurenz Albe


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: AW: SQL - How to iterate with delay in a loop
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox