Search Postgresql Archives

Re: strange error when inserting via a SRF into a table with a foreign key constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> create table fp1(a text, b text, primary key(a,b));
> create table foo (a text, b numeric, c text);
> 
> insert into foo select 'a', 1, explode_array(string_to_array('a,b',
> ',')); -- works
> truncate foo;
> alter table foo add foreign key(a,b) references fp1(a,b) on delete cascade;
> 
> insert into foo select 'a', 1, explode_array(string_to_array('a,b',
> ',')); -- fails

does it matter that fp1.b is text but foo.b is numeric?

Regards,

Richar Broersma Jr.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux