• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

178
Views
How to find the latitude value and save it in another table in postgresql

I have a shp file, I want to get the latitude value and store it in an another table.

CREATE TABLE Polepoints ( X varchar(50),Y varchar(50),Z  varchar(50));

Insert action :

INSERT INTO Polepoints (X) Select ST_X (ST_Centroid(geos)) from mytable

It throws out error

column X doesn't exist

but the column and the table exists. I am a beginner.

about 3 years ago · Santiago Trujillo
1 answers
Answer question

0

The problem has to be somewhere else. If the Polepoints table actually has a column named X , this error should not appear (see example below). Check if you are connected to the correct database or even if the polepoints in the polepoints table (the one containing column X ) is in a different schema.

 CREATE TABLE Polepoints ( X varchar(50),Y varchar(50),Z varchar(50)); WITH mytable (geos) AS ( VALUES ('POINT(1 1)'),('POINT(2 3)') ) INSERT INTO Polepoints (X) SELECT ST_X (ST_Centroid(geos)) FROM mytable; SELECT * FROM polepoints; x | y | z ---+---+--- 1 | | 2 | |
about 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error