Re: syntax error but command executes anyway? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: syntax error but command executes anyway?
Date
Msg-id 1087667732.28062.49.camel@localhost.localdomain
Whole thread Raw
In response to syntax error but command executes anyway?  (Kevin Murphy <murphy@genome.chop.edu>)
Responses Re: syntax error but command executes anyway?
List pgsql-general
On Sat, 2004-06-19 at 07:14, Kevin Murphy wrote:
> Using PG 7.4.3 on Mac OS X 10.2.8, the following "insert into ... select ..."
> statement completed and then announced a syntax error, which seems bizarre.

It's not actually inserting anything...

> (Don't be confused by the fact that the two tables referred to
> (public.identifiers and original.identifiers) have slightly different column
> names.)
>
> egenome_dev=# \!cat /Users/murphy/cvs/egora/sql/data_port/port_identifiers.sql
> INSERT INTO public.identifiers (element_id, name, source, source_code, title)
>         SELECT DISTINCT
>                 elementid,
>                 name,
>                 source,
>                 sourcecode,
>                 title
>         FROM original.identifiers;
> egenome_dev=# \i /Users/murphy/cvs/egora/sql/data_port/port_identifiers.sql
> INSERT 0 1672036

This INSERT 0 part tells you it didn't actually insert anything.
Since I don't see any obvious error, I'm wondering if maybe there are
characters in the sql file that don't print that are causing this
problem.  Try recreating the SQL by hand and see if you get the same
problem.  Use the simplest editor on your system, like vi or notepad or
whatever.



pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: INSERT BEFORE Trigger
Next
From: Tom Lane
Date:
Subject: Re: syntax error but command executes anyway?