I once had a very strange error with a table called "audit" on an oracle
database.
It turned out, that exspecially on oracle "audit" was a reserved word -
while it worked out fine on any other database.

I would recommend trying to use other column names.
As "end" is surrounded by double quites your database postgres also know
it as a reserved word. (see
https://stackoverflow.com/questions/5570783/using-end-as-column-name-in-ruby-on-rails-mysql)

Change the column name.

Kind regards
Cornelius

Am 21.06.2014 14:34, schrieb Chung WONG:
> Hi list,
> I am encountering a very strange error and I am scratching my head and
> got no idea what is going on. 
>
> class Line(Base):
>     __tablename__ = 'lines'
>     id = Column(Integer, Sequence('line_id_seq'), primary_key=True)
>
>     start = Column(Geometry('POINT'), nullable=False, *index=False*)
>     *end* = Column(Geometry('POINT'), nullable=False, *index=False*)
>
>
> On creating this table, it threw a strange error:
>
> /sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax error at
> or near "end"/
> /LINE 1: ...INDEX "idx_lines_end" ON "public"."lines" USING GIST (end)/
> /                                                                   ^/
> / 'CREATE INDEX "idx_lines_end" ON "public"."lines" USING GIST (end)' {}/
>
>
> The created table is :
>
> CREATE TABLE lines
> (
>   id integer NOT NULL,
>   start geometry(Point) NOT NULL,
>   *"end"* geometry(Point) NOT NULL,
>   CONSTRAINT lines_pkey PRIMARY KEY (id)
> )
> WITH (
>   OIDS=FALSE
> );
> ALTER TABLE lines
>   OWNER TO postgres;
>
> CREATE INDEX idx_lines_start
>   ON lines
>   USING gist
>   (start);
>
> It is weird there are quotes surrounding the word *end* , and although
> I have specified *index=False*, for some reason indexs are still
> created automatically.
> Anything other than *end*, such as *end_, end1 *worked perfectly.
> Is end a keyword for *postgis* or *geoalchemy2*?
>
> Thanks
> -- 
> You received this message because you are subscribed to the Google
> Groups "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sqlalchemy+unsubscr...@googlegroups.com
> <mailto:sqlalchemy+unsubscr...@googlegroups.com>.
> To post to this group, send email to sqlalchemy@googlegroups.com
> <mailto:sqlalchemy@googlegroups.com>.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to