Re: [BUGS] BUG #6083: psql script line numbers incorrectly count \copy data

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #6083: psql script line numbers incorrectly count \copy data
Дата
Msg-id 2822.1309795332@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: [BUGS] BUG #6083: psql script line numbers incorrectly count \copy data  (David Fetter <david@fetter.org>)
Re: [BUGS] BUG #6083: psql script line numbers incorrectly count \copy data  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
"Steve Haslam" <araqnid@googlemail.com> writes:
> ... Apparently, the data read from \copy
> is incrementing the script line number counter?

Yeah, so it is.  That is correct behavior for COPY FROM STDIN,
but not so much for copying from a separate file.

The attached patch seems like an appropriate fix.  However, I'm unsure
whether to apply it to released branches ... does anyone think this
might break somebody's application?

            regards, tom lane

diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c
index 5e69d29b6cbeab56aa0c85e85c3edce46d06efac..ebe5ee9ea551b858a4ad6119322405109d3212d8 100644
*** a/src/bin/psql/copy.c
--- b/src/bin/psql/copy.c
*************** handleCopyIn(PGconn *conn, FILE *copystr
*** 586,592 ****
                  }
              }

!             pset.lineno++;
          }
      }

--- 586,593 ----
                  }
              }

!             if (copystream == pset.cur_cmd_source)
!                 pset.lineno++;
          }
      }


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Следующее
От: Marios Vodas
Дата:
Сообщение: Perl 5.8 requirement for compiling on windows?