Re: syntax error but command executes anyway?
От | Tom Lane |
---|---|
Тема | Re: syntax error but command executes anyway? |
Дата | |
Msg-id | 18004.1087671447@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | syntax error but command executes anyway? (Kevin Murphy <murphy@genome.chop.edu>) |
Ответы |
Re: syntax error but command executes anyway?
|
Список | pgsql-general |
Kevin Murphy <murphy@genome.chop.edu> writes: > What should I make of this? > 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 > psql:/Users/murphy/cvs/egora/sql/data_port/port_identifiers.sql:15: ERROR: > syntax error at or near "sourcecode" at character 2 It seems mighty suspicious that psql is reporting a syntax error at line 15 of the file when cat is only showing 9 lines. I suspect that the insert you are showing us did execute, but then something further on in the file is producing the syntax error. I am wondering whether cat on OS X stops at embedded nulls, or something stupid like that. It sure looks like there must be garbage in the port_identifiers.sql file beyond what cat has printed here. What do you see when you examine the file with other tools? (Try "od -c" if nothing else springs to mind.) It is possible that the problem is not entirely cat's fault but has something to do with the way that psql's \! command invokes cat. Does cat at the shell prompt produce the same output? regards, tom lane
В списке pgsql-general по дате отправления: