I want to insert line value into table.
I already inserted point by using the folowing command:
INSERT INTO public."Sample"(point)
VALUES ( point(-71.060316, 48.432044));
but the similar command for line insertion:
INSERT INTO public."Sample"(line)
VALUES ( line( { -71.1, 48.2, 1.3}));
doesn't work.
Any help highly appreciated.
These native types do not have operator-constructors. They're implicitly coerced from strings.. Native types means that the database has native methods of storing and indexing them, not methods available to you to construct them from sql.
CREATE TEMPORARY TABLE foo AS
SELECT
linestr::line AS doublecolon, // different ways to cast.
line(linestr) AS functionconst, // different ways to cast.
CAST(linestr AS line) AS cast // different ways to cast.
FROM (
VALUES ( '{-71.1,48.2,1.3}'::text )
) AS t(linestr);
To construct a line..