Use Point data type in insert statement : Point « Data Type « PostgreSQL






Use Point data type in insert statement

postgres=#
postgres=# CREATE TABLE cities (
postgres(#    name            varchar(80),
postgres(#    location        point
postgres(# );
CREATE TABLE
postgres=#
postgres=# INSERT INTO cities VALUES ('San Francisco', '(-194.0, 53.0)');
INSERT 0 1
postgres=#
postgres=# select * from cities;
     name      | location
---------------+-----------
 San Francisco | (-194,53)
(1 row)

postgres=#
postgres=# drop table cities;
DROP TABLE
postgres=#

           
       








Related examples in the same category

1.Create table with point data type
2.Using Point data type in a function
3.Using point data type in insert statement