From: | Terry Lee Tucker <terry(at)esc1(dot)com> |
---|---|
To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Prompt User From a pgplsql Function |
Date: | 2005-01-29 18:21:02 |
Message-ID: | 200501291321.02486.terry@esc1.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks for the reply, Tom. I just had an idea about writting the answer from
the client to a table designed for that purpose. It could have a unique key
as the pid and a column for storing the answer. When the notice receiver
returns, I could have the function check for the answer in the table. I have
successfully created my own notice receiver and it works.
Maybe I can rewrite all this in C when I have more time. The heat is on to get
this thing done :o/
On Saturday 29 January 2005 11:09 am, Tom Lane saith:
> Terry Lee Tucker <terry(at)esc1(dot)com> writes:
> > Is there any way to gather input from a user while in the
> > middle of a transaction from a plpgsql function?
>
> Hmm ... RAISE NOTICE to send out the prompt, and then COPY from some
> pre-agreed file to collect the result? (COPY FROM STDIN would be nicer
> but it doesn't work inside plpgsql, and probably can't be made to work
> without breaking the FE/BE protocol.) Seems messy and insecure,
> not to mention it requires the client code to be on the same machine
> as the database. I think you'd be better off spending the time to
> restructure your functions, instead.
>
> If you were using one of the untrusted languages (plperlu etc) it might
> be possible to create a temporary side communication channel to talk to
> the client code, but that seems pretty messy as well.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2005-01-29 18:25:13 | Re: MySQL worm attacks Windows servers |
Previous Message | Max | 2005-01-29 18:20:39 | Re: Splitting queries across servers |