Re: [GENERAL] null values in a view

2011-10-05 Thread Lauri Kajan
On Wed, Oct 5, 2011 at 5:39 PM, Tom Lane wrote: > Lauri Kajan writes: >> This works with other values but not with nulls: > >> CREATE VIEW view1 AS >> SELECT >>   attribute1 as a1, >>   text null as a2, >>   text 'test' as a3 >> FROM >

[GENERAL] null values in a view

2011-10-05 Thread Lauri Kajan
I know that I should define a data type for a field a2. But how? This works with other values but not with nulls: CREATE VIEW view1 AS SELECT attribute1 as a1, text null as a2, text 'test' as a3 FROM table; Thanks -Lauri Kajan -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] join between a table and function.

2011-08-17 Thread Lauri Kajan
011, at 14:29, Merlin Moncure wrote: > >> On Tue, Aug 16, 2011 at 8:33 AM, Harald Fuchs wrote: >>> In article >>> , >>> Lauri Kajan writes: >>> >>>> I have also tried: >>>> select >>>> *, getAttributes(a.id) >>&

Re: [GENERAL] join between a table and function.

2011-08-16 Thread Lauri Kajan
6, 2011 at 12:17 PM, Chetan Suttraway wrote: > > > On Tue, Aug 16, 2011 at 1:11 PM, Lauri Kajan wrote: >> >> Hi all, >> >> I have made a function returning a custom record type that contains two >> fields. >> Now I want to select from that function. Ac

[GENERAL] join between a table and function.

2011-08-16 Thread Lauri Kajan
Hi all, I have made a function returning a custom record type that contains two fields. Now I want to select from that function. Actually I want to make a join with a table. Let me explain. Here is my function: CREATE TYPE attributes AS (class integer, type integer); CREATE OR REPLACE FUNCTION g