Re: [PATCH] "\ef " in psql
От | Tom Lane |
---|---|
Тема | Re: [PATCH] "\ef |
Дата | |
Msg-id | 7196.1220659847@sss.pgh.pa.us обсуждение исходный текст |
Ответ на |
Re: [PATCH] "\ef |
Ответы |
Re: [PATCH] "\ef Re: [PATCH] "\ef |
Список | pgsql-hackers |
Abhijit Menon-Sen <ams@oryx.com> writes: > I have attached two patches: > - funcdef.diff implements pg_get_functiondef() > - edit.diff implements "\ef function" in psql based on (1). I've applied this with some corrections (mostly around proper quoting) and some outright editorialization: * the psql command seemed to have some ideas about supplying a blank CREATE OR REPLACE FUNCTION command for a nonexistent function, but this didn't actually work. In any case it seemed poorly thought out, because you'd really need to pay some attention to *why* the regproc/regprocedure lookup failed. I just ripped it out for the moment. I'm not averse to the concept, if you can get it implemented properly. * the way you had it set up, the CREATE OR REPLACE FUNCTION command would be sent to the backend instantaneously upon return from the editor, with no opportunity for the user to decide he didn't want his changes applied. This seemed unacceptably dangerous to me. I changed the exit code to PSQL_CMD_NEWEDIT instead of PSQL_CMD_SEND, which causes the command to wait in the query buffer. Unfortunately there's no visual indication of that, other than a small change in the prompt status. It'd likely be better if we could get libreadline to redisplay the query buffer contents --- anyone have an idea how to do that? (I have some vague recollection that \e used to work that way, though it definitely fails to do so now.) regards, tom lane
В списке pgsql-hackers по дате отправления: