public inbox for [email protected]help / color / mirror / Atom feed
execution id 4+ messages / 3 participants [nested] [flat]
* execution id @ 2022-08-30 16:22 Voillequin, Jean-Marc <[email protected]> 0 siblings, 2 replies; 4+ messages in thread From: Voillequin, Jean-Marc @ 2022-08-30 16:22 UTC (permalink / raw) To: [email protected] <[email protected]> Hello guys, Is there a kind of magical system administration function that returns a unique id each time a select/insert/update/delete statement is launched? Assuming x is a table with several rows: select pg_magical_exec_id() from x; * returns 1 for each row insert into x select pg_magical_exec_id() from x; * pg_magical_exec_id()=2 Select 1 from x where pg_magical_exec_id()>0; * pg_magical_exec_id=3 Select pg_magical_exec_id() from x; * returns 4 for each row And even, in a transaction: Begin; delete from x where ...; * pg_magical_exec_id=5 update x set ... ; * pg_magical_exec_id=6 End; Select pg_magical_exec_id() from x; * returns 7 for each row I can understand it is a strange question! There is a txid_current() function that could fit, but the transaction id does not change within a transaction. ---------------------------------------------------------------------- Moody's monitors email communications through its networks for regulatory compliance purposes and to protect its customers, employees and business and where allowed to do so by applicable law. The information contained in this e-mail message, and any attachment thereto, is confidential and may not be disclosed without our express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify us by telephone, fax or e-mail and delete the message and all of its attachments. Every effort is made to keep our network free from viruses. You should, however, review this e-mail message, as well as any attachment thereto, for viruses. We take no responsibility and have no liability for any computer virus which may be transferred via this e-mail message. ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: execution id @ 2022-08-30 16:26 David G. Johnston <[email protected]> parent: Voillequin, Jean-Marc <[email protected]> 1 sibling, 1 reply; 4+ messages in thread From: David G. Johnston @ 2022-08-30 16:26 UTC (permalink / raw) To: Voillequin, Jean-Marc <[email protected]>; +Cc: [email protected] <[email protected]> On Tue, Aug 30, 2022 at 9:23 AM Voillequin, Jean-Marc < [email protected]> wrote: > Hello guys, > > > > Is there a kind of magical system administration function that returns a > unique id each time a select/insert/update/delete statement is launched? > > > Not sure why you thought the "SQL" list was a good choice for this question...but assuming you actually want something exposed to SQL the answer would be no. Internal state management (the "CommandCounter" as I believe it is called) is an implementation artifact not exposed to the DBA. David J. ^ permalink raw reply [nested|flat] 4+ messages in thread
* RE: execution id @ 2022-08-30 16:32 Voillequin, Jean-Marc <[email protected]> parent: David G. Johnston <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: Voillequin, Jean-Marc @ 2022-08-30 16:32 UTC (permalink / raw) To: David G. Johnston <[email protected]>; +Cc: [email protected] <[email protected]> I thought it was the good list because I was looking for a sql/pqsql function. What a pitty! The command counter was probably what I was looking for. Thanks David. From: David G. Johnston <[email protected]> Sent: Tuesday, August 30, 2022 6:27 PM To: Voillequin, Jean-Marc <[email protected]> Cc: [email protected] Subject: Re: execution id On Tue, Aug 30, 2022 at 9: 23 AM Voillequin, Jean-Marc <Jean-Marc. Voillequin@ moodys. com> wrote: Hello guys, Is there a kind of magical system administration function that returns a unique id each time a select/insert/update/delete statement ZjQcmQRYFpfptBannerStart This email originated from outside of Moody's Do not click links or open attachments unless you recognize the sender and know the content is safe. ZjQcmQRYFpfptBannerEnd On Tue, Aug 30, 2022 at 9:23 AM Voillequin, Jean-Marc <[email protected]<mailto:[email protected]>> wrote: Hello guys, Is there a kind of magical system administration function that returns a unique id each time a select/insert/update/delete statement is launched? Not sure why you thought the "SQL" list was a good choice for this question...but assuming you actually want something exposed to SQL the answer would be no. Internal state management (the "CommandCounter" as I believe it is called) is an implementation artifact not exposed to the DBA. David J. ---------------------------------------------------------------------- Moody's monitors email communications through its networks for regulatory compliance purposes and to protect its customers, employees and business and where allowed to do so by applicable law. The information contained in this e-mail message, and any attachment thereto, is confidential and may not be disclosed without our express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify us by telephone, fax or e-mail and delete the message and all of its attachments. Every effort is made to keep our network free from viruses. You should, however, review this e-mail message, as well as any attachment thereto, for viruses. We take no responsibility and have no liability for any computer virus which may be transferred via this e-mail message. ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: execution id @ 2022-08-30 16:55 hubert depesz lubaczewski <[email protected]> parent: Voillequin, Jean-Marc <[email protected]> 1 sibling, 0 replies; 4+ messages in thread From: hubert depesz lubaczewski @ 2022-08-30 16:55 UTC (permalink / raw) To: Voillequin, Jean-Marc <[email protected]>; +Cc: [email protected] <[email protected]> On Tue, Aug 30, 2022 at 04:22:45PM +0000, Voillequin, Jean-Marc wrote: > Hello guys, > > Is there a kind of magical system administration function that returns a unique id each time a select/insert/update/delete statement is launched? What is the usecase? You can get something like this with statement_timestamp() Best regards, depesz ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2022-08-30 16:55 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-08-30 16:22 execution id Voillequin, Jean-Marc <[email protected]> 2022-08-30 16:26 ` David G. Johnston <[email protected]> 2022-08-30 16:32 ` Voillequin, Jean-Marc <[email protected]> 2022-08-30 16:55 ` hubert depesz lubaczewski <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox