Re: pgsql: Add support for piping COPY to/from an external program.

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pgsql: Add support for piping COPY to/from an external program.
Дата
Msg-id 20130228163224.GL9507@alvh.no-ip.org
обсуждение исходный текст
Ответ на pgsql: Add support for piping COPY to/from an external program.  (Heikki Linnakangas <heikki.linnakangas@iki.fi>)
Список pgsql-committers
Heikki Linnakangas wrote:

> This creates a new function in pgport, wait_result_to_str(), which can
> be used to convert the exit status of a process, as returned by wait(3),
> to a human-readable string.

You have this:

+#ifndef FRONTEND
+   result = pstrdup(str);
+#else
+   result = strdup(str);
+#endif

This kind of thing is no longer necessary.  In frontend, libpgcommon
provides a pstrdup() implementation which is strdup() plus error check,
so you can reduce the above to simply

    result = pstrdup(str);

and it should work everywhere.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: pgsql: Add CREATE RECURSIVE VIEW syntax
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Blind attempt at fixing the non-MSVC Windows builds