Re: [HACKERS] Specifying Rowtypes

2003-01-29 Thread Christopher Kings-Lynne
No, in 7.3 you can create anonymous composite types using the CREATE TYPE command. Chris -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Curt Sampson Sent: Wednesday, 29 January 2003 1:45 PM To: PostgreSQL Development Subject: [HACKERS] Specifying

Re: [HACKERS] Specifying Rowtypes

2003-01-29 Thread Tom Lane
Curt Sampson [EMAIL PROTECTED] writes: So currently the only way to specify a row type is by using a table, No, as of 7.3 there's CREATE TYPE foo AS (column list). But ... This is returning a row that (to my mind) doesn't match the type of the table above, because it's returning null for

Re: [HACKERS] Specifying Rowtypes

2003-01-29 Thread Curt Sampson
On Tue, 28 Jan 2003, Stephan Szabo wrote: You can also return records at which point you have to give a definition at select time. create function aa1() returns record as 'select 1,2;' language 'sql'; select * from aa1() as aa1(a int, b int); Yeah, I tried that approach too, but it got ugly

Re: [HACKERS] Specifying Rowtypes

2003-01-29 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Wed, 29 Jan 2003, Curt Sampson wrote: ...produces rows with nulls in them. That's a bug in pl/pgsql I believe. Or a bug in the domain-constraints implementation. plpgsql just executes the input function for the datatype --- which is the same as the

[HACKERS] Specifying Rowtypes

2003-01-28 Thread Curt Sampson
So currently the only way to specify a row type is by using a table, right? E.g.: CREATE TABLE t2_retval ( value1 int NOT NULL DEFAULT -1, value2 int NOT NULL, value3 int ); Are there plans to add another way of declaring this sort of thing so that I don't have