postgresql - PGSQL - inserting null values into table -


after executing following query:

insert regiony  (m_valid, m_validationreport,  m_creation_timestamp, m_creation_user,  m_modification_timestamp, m_modification_user,  instance, kod_regionu, nazwa_gminy, kod_teryt)   select distinct null, null, now(), 'abc', now(),  'abc', null, region_poch, export_gmina, replace(teryt, '|', '') source_table 

i following error:

error: column "m_valid" of type boolean expression of type text

i tried convert null value boolean (null::boolean), , worked boolean, instance column in target table (regiony) of type xml , pgsql refuses convert null xml. after converting null xml, get:

error: not identify equality operator type xml

any suggestions? of columns receiving null values allow null values , i'm running out of ideas.

cheers, jan

try rewriting without explicit null statements, letting pg handle them needed:

insert regiony (   m_creation_timestamp,   m_creation_user,   m_modification_timestamp,   m_modification_user,   kod_regionu,   nazwa_gminy,   kod_teryt   ) select distinct now(),   'abc',   now(),   'abc',   region_poch,   export_gmina,   replace(teryt, '|', '') source_table 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -