Re: Return key from query

Поиск
Список
Период
Сортировка
От Jonathan Tripathy
Тема Re: Return key from query
Дата
Msg-id 4CD191D0.4020905@abpni.co.uk
обсуждение исходный текст
Ответ на Re: Return key from query  (Rob Sargent <robjsargent@gmail.com>)
Ответы Re: Return key from query  (Szymon Guz <mabewlun@gmail.com>)
Re: Return key from query  ("Igor Neyman" <ineyman@perceptron.com>)
Список pgsql-general
>>
>> Sorry, I don't get it. I usually have an application that knows if it
>> wants to write some data to database, or not. So it writes the data, and
>> just gets from database the id that was set by database. No need of
>> getting the id earlier in a transaction, although the simple insert that
>> saves the data runs in a transaction of course.
>> Another approach could be just getting the id from database, and saving
>> the data using that id. If someone puts there any complicated logic
>> between getting id and saving data, it is just a very bad software
>> design, that has nothing common with the id/uuid problem.
>>

All my software is doing is running a simple INSERT query on a table,
with the primary key auto-incremented. I just have no way of knowing
what the new ID is once the query is done. My problem is simpler than
soft folk here think, however I feer that the solution is harder than I
think :(



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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Return key from query
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: How to configure pgsql in such a way that it is always recoverable?