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

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>, PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: strange error when inserting via a SRF into a table with a foreign key constraint
Date: 2006-10-11 21:43:39
Message-ID: 20061011214339.2004.qmail@web31801.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-10-11 22:24:31 Re: [GENERAL] strange error when inserting via a SRF into a table with a foreign key constraint
Previous Message Merlin Moncure 2006-10-11 21:27:39 Re: Is it possible to return custom type as proper ROW?

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2006-10-11 21:52:58 Re: Index Tuning Features
Previous Message Merlin Moncure 2006-10-11 21:18:13 strange error when inserting via a SRF into a table with a foreign key constraint