Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a table with one column (double precision numbers). I also have made a function (with double precision numbers as input and output), and I want to send every value of my table to the function, and store the output in a second (new) column.

What is the best way to do this? Make a void function with a loop in it? Or are there better ways?


share|improve this question

migrated from Mar 31 '14 at 13:49

This question came from our site for cartographers, geographers and GIS professionals.

UPDATE mytbl
SET col2=myfn(col1)

should do the trick

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.