SELECT ARRAY[thenumeric::real] FROM the_table;
or
SELECT ARRAY[thenumeric]::real[] FROM the_table;
They do not differ from each other for a singleton array.
real has limits that numeric does not have. In particular, comparing real values โโfor equality does not work reliably; instead, you should compare that for two digits a smaller than a small (to some extent given a task) sum differs. It also cannot represent values โโas large or small, as numerical. See the floating point guide for other information on comparing floats. It will be much harder to do it right when they are wrapped in arrays.
For the purpose of describing where it sounds like you are simply collecting statistics or historical data, this will not be a problem. This usually turns out to be a problem when people try to write:
WHERE some_real = some_other_real
which will lead to unexpected and unexpected behavior.
You should be fine with INSERT INTO ... SELECT as described.
source share