Add \i option to bring in the specified file as a quoted literal

Поиск
Список
Период
Сортировка
От Piotr Marcinczyk
Тема Add \i option to bring in the specified file as a quoted literal
Дата
Msg-id 1382391295.26698.61.camel@centos
обсуждение исходный текст
Ответы Re: Add \i option to bring in the specified file as a quoted literal  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Hi,

I would like to implement item from TODO marked as easy: "Add \i option
to bring in the specified file as a quoted literal". I understand intent
of this item, to be able to have parts of query written in separate
files (now it is impossible, because \i tries to execute content of file
as a separate command by function process_file).

Implementation:
I will add command "iq" and "include_quoted" in src/bin/psql/command.c
(in the same block where "i" and "ir" are implemented). If "iq" is
detected I will call new function do_append(fname, query_buf) which will
read file into query_buffer and return status PSQL_CMD_NEWEDIT.

User perespective:
User will be able to append file to current buffer. It will be possible
to include code of procedure, or where part of select statement.
ex:
select * from
/iq where_part.sql
and lang_name='SQL'
;

Questions:
Variables like :myvar will be replaced with their values, is that ok?
Shall I start to code this patch?

Best regards
Piotr Marcinczyk




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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Cube extension point support // GSoC'13
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Add min and max execute statement time in pg_stat_statement