Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8590621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:20:10+00:00 2026-06-11T23:20:10+00:00

I have this Postgres/PostGIS query: UPDATE raw.geocoding SET the_geom = ST_Transform(ST_GeomFromText(‘POINT(((E’-96.6864379495382′)::float8) ((E’32.792527154088′)::float8))’, 4326),3081) WHERE

  • 0

I have this Postgres/PostGIS query:

UPDATE raw.geocoding
SET the_geom = ST_Transform(ST_GeomFromText('POINT(((E'-96.6864379495382')::float8) ((E'32.792527154088')::float8))', 4326),3081)
WHERE id=((10793455)::int4)

When I run it, I get this error:

ERROR:  syntax error at or near "')::float8) ((E'"
LINE 2: ...sform(ST_GeomFromText('POINT(((E'-96.6864379495382')::float8...
                                                             ^

********** Error **********

ERROR: syntax error at or near "')::float8) ((E'"
SQL state: 42601
Character: 94

I’m scratching my head because PostGIS doesn’t have a problem with escaped data (for example), and the query was generated from npgsql based on this parameterized query:

UPDATE raw.geocoding
SET the_geom = ST_Transform(ST_GeomFromText('POINT(:longitude :latitude)', 4326),3081)
WHERE id=:id

I am running Postgres 9.1.5 and PostGIS 2.0.1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:20:12+00:00Added an answer on June 11, 2026 at 11:20 pm

    The error results from unescaped single quotes in the string. The standard way is to double them:

    UPDATE raw.geocoding
    SET    the_geom = ST_Transform(ST_GeomFromText(
                   'POINT(((E''-96.6864379495382'')::float8)
                         ((E''32.792527154088'')::float8))', 4326),3081)
    WHERE  id=((10793455)::int4)

    This fixes the string literal, but you have more errors.
    Like @Paul hinted in a comment, ST_GeomFromText() expects the geometry WKT POINT(0 0). The explicit cast to float8 makes it look like you are trying to enter the Postgres function point() (had me confused at first). Simplify to:

    UPDATE raw.geocoding
    SET    the_geom = ST_Transform(ST_GeomFromText(
                      $$POINT(96.6864379495382 32.792527154088)$$, 4326), 3081)
    WHERE  id = 10793455

    Note also, how I use dollar quoting in the second example to avoid having to escape single quotes altogether. As there aren’t any single quotes left in your string literal after fixing the syntax, you might as well use single quotes again. Your parametrized query:

    UPDATE raw.geocoding
    SET    the_geom = ST_Transform(ST_GeomFromText(
                      $$POINT(:longitude :latitude)$$::geometry, 4326), 3081)
    WHERE  id = :id

    You can add a cast to geometry to make it clear, like @Paul advises in his comment. But it works without explicit cast, too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this postgres sql query: select * from stats where athlete_id = 5
I have this regex in a query in postgres and I cannot figure out
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
EDIT: I have been using Postgres with PostGIS for a few months now, and
I am stuck here. I have row in Postgres like this: id amount a
I'm using postgres (postgis) and i want to perform a query that returns all
I have this table in a postgres 8.4 database: CREATE TABLE public.dummy ( address_id
I have a table in postgres like this: Id Name local_site_id local_id 1 A
I have something like this in a postgres db: | foo | 1,2 |
Say I have this query: SELECT name::text, id::int, pass:bool FROM mytable; which gives me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.