On 02/03/2010 04:49 AM, Rushabh Lathia wrote:
> Testcase:
>
> create table foo (a int );
> postgres=# SELECT dblink_build_sql_insert('foo','1 2',2,'{\"0\",
> \"a\"}','{\"99\", \"xyz\"}');
> HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
> server closed the connection unexpectedly
Thanks for the report -- will have a look later today.
Joe
On 02/03/2010 04:49 AM, Rushabh Lathia wrote:
>
> create table foo (a int );
> postgres=# SELECT dblink_build_sql_insert('foo','1 2',2,'{\"0\",
> \"a\"}','{\"99\", \"xyz\"}');
> HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
> server closed the connection unexpectedly
The problem exists with all three dblink_build_sql_* functions. Here is
a more complete patch. If there are no objections I'll apply this to
HEAD and look at back-patching -- these functions have hardly been
touched since inception.
Joe
Joe Conway <mail@joeconway.com> writes:
> The problem exists with all three dblink_build_sql_* functions. Here is
> a more complete patch. If there are no objections I'll apply this to
> HEAD and look at back-patching -- these functions have hardly been
> touched since inception.
Do you really need to copy the relation tupdesc when you only are going
to make a one-time check of the number of attributes? This coding would
make some sense if you intended to use the tupdesc again later in the
functions, but it appears you don't.
Also, what about cases where the relation contains dropped columns ---
it's not obvious whether this test is correct in that case.
regards, tom lane
On 02/03/2010 10:18 AM, Tom Lane wrote: > Joe Conway <mail@joeconway.com> writes: >> The problem exists with all three dblink_build_sql_* functions. Here is >> a more complete patch. If there are no objections I'll apply this to >> HEAD and look at back-patching -- these functions have hardly been >> touched since inception. > > Do you really need to copy the relation tupdesc when you only are going > to make a one-time check of the number of attributes? This coding would > make some sense if you intended to use the tupdesc again later in the > functions, but it appears you don't. > > Also, what about cases where the relation contains dropped columns --- > it's not obvious whether this test is correct in that case. Good input, as always. Here's another whack at it. Thanks, Joe
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера