Re: [GENERAL] UPDATE an updatable view

2015-08-28 Thread David Nelson
> Just for the sake of completeness... > > If the value (empname in the above example) can be NULL, the compare does not work, because > > SELECT NULL = NULL > > returns NULL which is treated as FALSE. > > But I am sure you know this :-) > > > HTH, > > Ladislav Lenart > > __

Re: [GENERAL] UPDATE an updatable view

2015-08-28 Thread David Nelson
On Fri, Aug 28, 2015 at 6:39 AM, Ladislav Lenart wrote: > > Hello. > > > On 27.8.2015 18:35, David Nelson wrote: > >>> So in the UPDATE statement, I only provided a value for last_user. But the > >>> first test of the trigger function tests for a NULL value

Re: [GENERAL] UPDATE an updatable view

2015-08-28 Thread David Nelson
On Thu, Aug 27, 2015 at 1:21 PM, Jerry Sievers wrote: > > David Nelson writes: > > >>> So in the UPDATE statement, I only provided a value for last_user. But the > >>> first test of the trigger function tests for a NULL value of > >>> NEW.empn

Re: [GENERAL] UPDATE an updatable view

2015-08-27 Thread David Nelson
>> So in the UPDATE statement, I only provided a value for last_user. But the >> first test of the trigger function tests for a NULL value of >> NEW.empname. Since >> I did not provide one, I was expecting it to be NULL and an exception to >> be thrown. Am I just misunderstanding how things work? I

[GENERAL] UPDATE an updatable view

2015-08-27 Thread David Nelson
Good morning all, I am creating an updatable view on a set of tables, and just ran into unexpected (or more likely misunderstood) behavior with the UPDATE statement. If an attribute is not explicitly listed in the UPDATE statement, the NEW value appears to be populated with the OLD value. Unless I

Re: [GENERAL] Count of non-null values per table column

2015-08-15 Thread David Nelson
On Fri, Aug 14, 2015 at 9:17 PM, Ken Tanzer wrote: > On Fri, Aug 14, 2015 at 6:35 PM, David Nelson > wrote: > >> On Fri, Aug 14, 2015 at 10:00 AM, Tom Lane wrote: >> > >> > David Rowley writes: >> > > >> Tthat is the way I would do it for a

Re: [GENERAL] Count of non-null values per table column

2015-08-14 Thread David Nelson
On Fri, Aug 14, 2015 at 10:00 AM, Tom Lane wrote: > > David Rowley writes: > > On 15 August 2015 at 02:32, David Nelson wrote: > >> Hello list,Apologies if this has been asked before. My search only > >> turned up ways to list the total non-null values for all colu

Re: [GENERAL] Count of non-null values per table column

2015-08-14 Thread David Nelson
On Fri, Aug 14, 2015 at 9:59 AM, John McKown wrote: > > David, > > It still came through as junk. But I reconstructed it below > > === original message === > Apologies if this has been asked before. My search only turned up ways to list the total non-null values for all columns as a single number.

Re: [GENERAL] Count of non-null values per table column

2015-08-14 Thread David Nelson
Well it is certainly nice to see that my choice to send my question using plain text was honored by this email service. Apologies for that mess. The output I am looking for is a series of rows with two columns, one the name of the table column, and the other the count of non-null values in a tab

[GENERAL] Count of non-null values per table column

2015-08-14 Thread David Nelson
Hello list,Apologies if this has been asked before. My search only turned up ways to list the total non-null values for all columns as a single number. I want the count for each column by column.I have inherited a database consisting of two related huge monolithic tables that lack referential i