ToDo: allow to get a number of processed rows by COPY statement

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема ToDo: allow to get a number of processed rows by COPY statement
Дата
Msg-id CAFj8pRAeEUSP8zuNkNcMP1gkr_i9KVN76S+A+13ehj=Z8E5Wow@mail.gmail.com
обсуждение исходный текст
Ответы Re: ToDo: allow to get a number of processed rows by COPY statement
Re: ToDo: allow to get a number of processed rows by COPY statement
Список pgsql-hackers
Hello

There is not possible to get a number of processed rows when COPY is
evaluated via SPI. Client can use a tag, but SPI doesn't use a tag.

I propose a small change a ProcessUtility to return a processed rows.

Note: I found a small inconsistency between SPI and Utility interface.
SPI still use a 4 byte unsign int for storing a number of processed
rows. Utility use a 8bytes unsign int.

Motivation:

 postgres=# \sf fx
CREATE OR REPLACE FUNCTION public.fx(tablename text, filename text)
 RETURNS integer
 LANGUAGE plpgsql
AS $function$
declare r int;
begin
  execute format('COPY %s FROM %s', quote_ident(tablename),
quote_literal(filename));
  get diagnostics r = row_count;
  return r;
end;
$function$

Regards

Pavel Stehule

Вложения

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

Предыдущее
От: Shigeru Hanada
Дата:
Сообщение: Re: WIP: Join push-down for foreign tables
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: [REVIEW] pg_last_xact_insert_timestamp