Re: [SQL] new max function

2003-10-17 Thread Tom Lane
Mike Rylander <[EMAIL PROTECTED]> writes: > Here's mine: > CREATE FUNCTION max2 (INTEGER,INTEGER) RETURNS INTEGER > LANGUAGE SQL AS > 'SELECT CASE WHEN $1 > $2 THEN $1 ELSE $2 END'; BTW, most of the standard datatypes have these already, because they are the transition functions for the MAX()

Re: [SQL] new max function

2003-10-17 Thread Mike Rylander
Here's mine: CREATE FUNCTION max2 (INTEGER,INTEGER) RETURNS INTEGER LANGUAGE SQL AS 'SELECT CASE WHEN $1 > $2 THEN $1 ELSE $2 END'; This returns: database=# select max2(1,2); max2 -- 2 (1 row) database=# select max2(3,1); max2 -- 3 (1 row) On Friday 17 October 2003 02

[SQL] [postgres] IPv6-Datentyp(en) in PostgreSQL?

2003-10-17 Thread stephan . rupp
Hallo, Liste! Gibt es schon (konkrete) Pläne, analog zum IPv4-Datentyp auch IPv6 als Datentyp in PostgreSQL zu implementieren? Interessieren würde mich auch, was der Unterschied zwischen den beiden schon bestehenden Datentypen "inet" und "cidr" ist. Vielen Dank schon im voraus für Eure Antwort

[SQL] Add column with specific colid

2003-10-17 Thread Olga Macias
I have a question   How could I add a column in a table but specific colid?     Thanks

Re: [SQL] [postgres] IPv6-Datentyp(en) in PostgreSQL?

2003-10-17 Thread stephan . rupp
Hallo, Ewald, vielen Dank für Deine Antwort. Am 17 Oct 2003 um 13:43 hat Ewald Geschwinde geschrieben: > [EMAIL PROTECTED] wrote: > > >Hallo, Liste! > > > >Gibt es schon (konkrete) Pläne, analog zum IPv4-Datentyp auch IPv6 als > >Datentyp in PostgreSQL zu implementieren? > > > >Intere

[SQL] new max function

2003-10-17 Thread Rodrigo Gesswein
Hello! I'm looking for a function to calculate the max value from two numbers, something like max2(a,b) with a,b int Does anyone have the trick ? Thank you in advance.. Rodrigo! ---(end of broadcast)--- TIP 3: if posting/reading through

Re: [SQL] Object description at Client Window

2003-10-17 Thread George Weaver
Kumar, pg_class.relname is type "name". You are trying to compare it to p_tablename which is type "varchar". Try changing your function definition to: CREATE OR REPLACE FUNCTION public.desc_table(name) HTH George SNIP > CREATE OR REPLACE FUNCTION public.desc_table(varchar) > RETURNS re

Re: [SQL] Object description at Client Window

2003-10-17 Thread achill
On Fri, 17 Oct 2003, Kumar wrote: > But I have get into another problem. While I execute the following command I > could get the result as U can see below > > etgsuite=# SELECT a.attname,format_type(a.atttypid, a.atttypmod), > a.attnotnull, a.atthasd > ef, a.attnum > FROM pg_class c, pg_attribute

Re: [SQL] [postgres] IPv6-Datentyp(en) in PostgreSQL?

2003-10-17 Thread Ewald Geschwinde
http://developer.postgresql.org/ unten der link sgml docs [EMAIL PROTECTED] wrote: > Hallo, Ewald, > > vielen Dank für Deine Antwort. > > Am 17 Oct 2003 um 13:43 hat Ewald Geschwinde geschrieben: > >> [EMAIL PROTECTED] wrote: >> >> >Hallo, Liste! >> > >> >Gibt es schon (konkrete) Pläne, analog z

Re: [SQL] Object description at Client Window

2003-10-17 Thread Kumar
But I have get into another problem. While I execute the following command I could get the result as U can see below etgsuite=# SELECT a.attname,format_type(a.atttypid, a.atttypmod), a.attnotnull, a.atthasd ef, a.attnum FROM pg_class c, pg_attribute a WHERE c.relname = 'companies' AND a.attnum > 0

Re: [SQL] Object description at Client Window

2003-10-17 Thread Kumar
I am sorry. Yes it worked. Thank you very much Mr. Jordan and Mr. Richard. - Original Message - From: "Richard Huxton" <[EMAIL PROTECTED]> To: "Kumar" <[EMAIL PROTECTED]>; "Jordan S. Jones" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, October 17, 2003 2:54 PM Subject: Re: [SQ

Re: [SQL] [postgres] IPv6-Datentyp(en) in PostgreSQL?

2003-10-17 Thread Ewald Geschwinde
[EMAIL PROTECTED] wrote: >Hallo, Liste! > >Gibt es schon (konkrete) Pläne, analog zum IPv4-Datentyp auch IPv6 als >Datentyp in PostgreSQL zu implementieren? > >Interessieren würde mich auch, was der Unterschied zwischen den beiden >schon bestehenden Datentypen "inet" und "cidr" ist. > >Vielen Da

Re: [SQL] Object description at Client Window

2003-10-17 Thread Richard Huxton
On Friday 17 October 2003 09:44, Kumar wrote: > Hi , > > Jordan, thanks for ur reply. But I am not asking that. > > I want to get all the column names of any table at the PgAdmin3 SQL Window. > To make it more clear, actually i wanted to send the table name as the > input parameter for a function a

Re: [SQL] Object description at Client Window

2003-10-17 Thread Kumar
Hi ,   Jordan, thanks for ur reply. But I am not asking that.   I want to get all the column names of any table at the PgAdmin3 SQL Window. To make it more clear, actually i wanted to send the table name as the input parameter for a function and expecting the column names, data types, etc as