Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread David Fetter
On Wed, Jul 12, 2006 at 11:37:04PM -0400, Tom Lane wrote:
 Merlin Moncure [EMAIL PROTECTED] writes:
  On 7/12/06, Timothy Perrigo [EMAIL PROTECTED] wrote:
  Is there a way to get the names of the arguments to a function
  from psql?  /df and /df+ return the parameter types, but not
  their names.
 
  select oid::regprocedure from pg_proc where proname like 'your
  name here';
 
 Nope, because regprocedureout doesn't include argument names (nor
 modes).  I think the best way ATM is to look directly at
 pg_proc.proargnames :-(

Back when, I submitted a psql patch to get the input names along with
their types.  Shall I dig up that code this weekend?

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread Merlin Moncure

On 7/13/06, David Fetter [EMAIL PROTECTED] wrote:

On Wed, Jul 12, 2006 at 11:37:04PM -0400, Tom Lane wrote:
  select oid::regprocedure from pg_proc where proname like 'your
  name here';

 Nope, because regprocedureout doesn't include argument names (nor
 modes).  I think the best way ATM is to look directly at
 pg_proc.proargnames :-(


whoop! misread it :)


Back when, I submitted a psql patch to get the input names along with
their types.  Shall I dig up that code this weekend?


that would be great, although is there any concern about backwards
compatibility of regprocedure cast? would it be safer to make a new
cast?  also, does your patch account for in/out?

merlin

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread David Fetter
On Thu, Jul 13, 2006 at 09:22:56AM -0400, Merlin Moncure wrote:
 On 7/13/06, David Fetter [EMAIL PROTECTED] wrote:
 On Wed, Jul 12, 2006 at 11:37:04PM -0400, Tom Lane wrote:

 Back when, I submitted a psql patch to get the input names along
 with their types.  Shall I dig up that code this weekend?
 
 that would be great, although is there any concern about backwards
 compatibility of regprocedure cast?

I'm not really concerned with any backwards compatibility for this new
feature, as psql has never attempted it for backslash commands.

 would it be safer to make a new cast?  also, does your patch account
 for in/out?

If it didn't, it will. :)

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread David Fetter
On Thu, Jul 13, 2006 at 03:39:34PM +0200, Peter Eisentraut wrote:
 Am Donnerstag, 13. Juli 2006 15:16 schrieb David Fetter:
  Back when, I submitted a psql patch to get the input names along
  with their types.  Shall I dig up that code this weekend?
 
 Seems reasonable, as long as it doesn't make the output an extra
 three screens wide.

I can't guarantee that people haven't given their input parameters
names like supercalifragilisticexpialidocious_input_01.  I could try
something that would wrap in such cases, but that's a lot more code.
Should I try something that wraps?

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread Peter Eisentraut
Am Donnerstag, 13. Juli 2006 15:16 schrieb David Fetter:
 Back when, I submitted a psql patch to get the input names along with
 their types.  Shall I dig up that code this weekend?

Seems reasonable, as long as it doesn't make the output an extra three screens 
wide.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 6: explain analyze is your friend


[GENERAL] getting function argument names from psql?

2006-07-12 Thread Timothy Perrigo
Is there a way to get the names of the arguments to a function from  
psql?  /df and /df+ return the parameter types, but not their names.


Thanks,
Tim

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] getting function argument names from psql?

2006-07-12 Thread Michael Fuhr
On Wed, Jul 12, 2006 at 07:33:09AM -0700, Timothy Perrigo wrote:
 Is there a way to get the names of the arguments to a function from  
 psql?  /df and /df+ return the parameter types, but not their names.

One way would be to look at pg_proc.proargnames.

http://www.postgresql.org/docs/8.1/interactive/catalog-pg-proc.html

-- 
Michael Fuhr

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] getting function argument names from psql?

2006-07-12 Thread Merlin Moncure

On 7/12/06, Timothy Perrigo [EMAIL PROTECTED] wrote:

Is there a way to get the names of the arguments to a function from
psql?  /df and /df+ return the parameter types, but not their names.



select oid::regprocedure from pg_proc where proname like 'your name here';

merlin

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] getting function argument names from psql?

2006-07-12 Thread Tom Lane
Merlin Moncure [EMAIL PROTECTED] writes:
 On 7/12/06, Timothy Perrigo [EMAIL PROTECTED] wrote:
 Is there a way to get the names of the arguments to a function from
 psql?  /df and /df+ return the parameter types, but not their names.

 select oid::regprocedure from pg_proc where proname like 'your name here';

Nope, because regprocedureout doesn't include argument names (nor modes).
I think the best way ATM is to look directly at pg_proc.proargnames :-(

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster