Re: ERROR: column "gid" specified more than once - Mailing list pgsql-sql

From David G. Johnston
Subject Re: ERROR: column "gid" specified more than once
Date
Msg-id CAKFQuwbVVDDjxPve410YZiFOAOMhM8mmsfK1zcmAp7=zoRTzpw@mail.gmail.com
Whole thread Raw
In response to ERROR: column "gid" specified more than once  (BahramPSQL <bahramjomezade.gis92@gmail.com>)
List pgsql-sql
On Tuesday, May 12, 2015, BahramPSQL <bahramjomezade.gis92@gmail.com> wrote:
I want to run a spatial query from two table!

CREATE TABLE "BorujerdDistCent" as
SELECT
  *, st_distance(st_centroid("Lorestan".geometry),"Borujerd".geometry)/1000
as DistFromCntroid
FROM "Borujerd", "Lorestan"
Where "Lorestan"."Shahrestan" = 'بروجرد'
ORDER BY
  "Borujerd".abady_name ASC

But i will see this error!
ERROR:  column "gid" specified more than once
********** Error **********

ERROR: column "gid" specified more than once
SQL state: 42701


This is not a bug.  You need to rewrite the query to avoid two output columns named "gid".

David J. 

pgsql-sql by date:

Previous
From: BahramPSQL
Date:
Subject: ERROR: column "gid" specified more than once
Next
From: Jason Aleski
Date:
Subject: Re: ERROR: column "gid" specified more than once