Re: syntax error but command executes anyway?

From: "Scott Marlowe" <smarlowe(at)qwest(dot)net>
To: "Kevin Murphy" <murphy(at)genome(dot)chop(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: syntax error but command executes anyway?
Date: 2004-06-19 17:55:32
Message-ID: 1087667732.28062.49.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shanmugasundaram Doraisamy 2004-06-19 18:12:31 Need help with Dead Lock - reg.
Previous Message Stephan Szabo 2004-06-19 16:57:08 Re: INSERT BEFORE Trigger