Getting last inserted id for each row in postgres

One Star

Getting last inserted id for each row in postgres

Hi!
This has been discussed many times, but I couldn't find the solution for the exact use case, so any help is appreciated.
So after each row of an insert i'd like to somehow get back the current value of the sequence that was used for the insert, to use in in later tPostgressqlOutput components.
Simplified requirement: Start->Insert User->Insert role for given user
I have done much more complicated things, so I am really stunned why I can't find out the solution myself. For me it is strange that tPostgressqlOutput does not support inserts that return a value.
thanks
eliott
One Star

Re: Getting last inserted id for each row in postgres

I've just found a topic that describes a similar requirement and also suggest a solution:
http://www.talendforge.org/forum/viewtopic.php?id=14113
it this is solved than.
Moderator

Re: Getting last inserted id for each row in postgres

Hi eliott100,
Thanks for your feedback. Could you please mark this post as resolved?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.