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

Re: [HACKERS] Specifying Rowtypes

2003-01-29 Thread Stephan Szabo
On Wed, 29 Jan 2003, Curt Sampson wrote: > On Tue, 28 Jan 2003, Stephan Szabo wrote: > > I believe only the column names and types are considered for purposes of > > this. Check constraints and the like defined on the column aren't applied > > either. I can see arguments for both ways since thin

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

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 Christopher Kings-Lynne
Subject: [HACKERS] Specifying Rowtypes > > > > 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 > ); > >

Re: [HACKERS] Specifying Rowtypes

2003-01-29 Thread Stephan Szabo
On Wed, 29 Jan 2003, Curt Sampson wrote: > > 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

[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 to