Answer the question
In order to leave comments, you need to log in
How to explicitly refer to composite type columns in Postgre?
There is a composite type:
CREATE TYPE t_well AS (
id INTEGER,
name VARCHAR(10),
altitude NUMERIC(10,3),
x NUMERIC(10,6),
y NUMERIC(10,6)
);
SELECT * FROM p_well_operations_new(1, ROW(1, 'bla', 42, 1.99, 3.45));
SELECT * FROM p_well_operations_new(1, ROW(id=1, name='bla',...));
Answer the question
In order to leave comments, you need to log in
When selecting a field from a value of a composite type, similar syntactic incidents are also possible. For example, to select one field from the result of a function that returns a composite value, you would write something like this:
SELECT (my_func(...)).field FROM ...
Without the extra parentheses, this query would generate a syntax error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question