[SQL] How can I retrieve an info about function arguments ?

2002-10-25 Thread Zuev Dmitry
Hello All
Consider a function:
create function f(varchar(10), decimal(10,1)) returns integer as 'select 1;'
language sql;
I need to retreive full set of info about argument and return types (for
variable length too).
How I can get it from system catalog ?
For tables columns I can gen an info from pg_attribute table. But in case of
function no entry are present there.
pg_proc has no info about length of variable length types.

__ Dmitry
Vitalievitch ICQ#: 1108 Current ICQ status: + More ways to contact me
__



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

http://archives.postgresql.org



[SQL] help on sql query

2002-11-26 Thread Zuev Dmitry

Suppose you have a table T:

--

A  B

--

1 '111'

2 '222'

--

How do you select A and B of the record with A maximum?

The desirable result therefore is (2, '222')

The two variants I could grow with are:

1) SELECT A, B FROM T ORDER BY A DESC LIMIT 1

2) SELECT A, B FROM T WHERE A IN (SELECT MAX(A) FROM T)

What do yo think of the queries above? And give me the better implementation
if possible.

__ Dmitry
Vitalievitch ICQ#: 1108 Current ICQ status: + More ways to contact me
__



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

http://archives.postgresql.org