PostgreSQL - check if a row is completely filled in -


i've seen questions checking if row merely exists, haven't seen (on or elsewhere) whether or not all data filled in.

i hoping select true mytable name='myrow' , * not null; work, doesn't.

what wildcard work in place of asterisk, if there one? have put in each column name query individually?

you can indeed reference whole row, not using *, using table name:

select true  mytable  name='myrow'    , mytable not null; 

the is not null operator on row value returns true if all columns of row not null.

the following statement:

with mytable (col1, col2, col3) ( values    (1,null,null),   (null,1,null),    (null,null,1),   (1,1,1) )  select * mytable  mytable not null; 

will return:

col1 | col2 | col3 -----+------+-----    1 |    1 |    1 

the opposite btw. not true. where mytable null not return because row definition never null (because wouldn't exist). find rows @ least 1 column null need use where not (mytable not null)

a similar problem described here: https://dba.stackexchange.com/q/143959/1822


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -