pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Randall Lucas <rlucas@tercent.net>
To: Rod Taylor <rbt@rbt.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: merge-join for domain with underlying type text
Date: Sat, 10 May 2003 19:40:48 -0400
Message-ID: <D3D5C340-8340-11D7-B164-000A957653D6@tercent.net> (raw)
In-Reply-To: <1052604804.48831.19.camel@jester>

-- Hmm, here's some code that manifests the problem:

-- using text itself:
create table text_test_1 (
  key text,
  stuff varchar
);
insert into text_test_1 values ('alpha', 'asdflkjasdf');
insert into text_test_1 values ('bravo', 'asdfdasfsaff');
insert into text_test_1 values ('delta', 'asdfasfdas');
create table text_test_2 (
  other_key text,
  more_stuff varchar
);
insert into text_test_2 values ('charlie', 'asdfasfasfda');
insert into text_test_2 values ('delta', 'asgasgdda');
insert into text_test_2 values ('echo', 'asdasfsdfsfda');
select * from text_test_1 full outer join text_test_2 on  
text_test_1.key = text_test_2.other_key;

-- Works OK, BUT:

-- using domain textual:
create domain textual_test as text;
create table textual_test_1 (
  key textual_test,
  stuff varchar
);
insert into textual_test_1 values ('alpha', 'asdflkjasdf');
insert into textual_test_1 values ('bravo', 'asdfdasfsaff');
insert into textual_test_1 values ('delta', 'asdfasfdas');
create table textual_test_2 (
  other_key textual_test,
  more_stuff varchar
);
insert into textual_test_2 values ('charlie', 'asdfasfasfda');
insert into textual_test_2 values ('delta', 'asgasgdda');
insert into textual_test_2 values ('echo', 'asdasfsdfsfda');
select * from textual_test_1 full outer join textual_test_2 on  
textual_test_1.key = textual_test_2.other_key;

-- Will give ERROR:  FULL JOIN is only supported with mergejoinable  
join conditions

-- clean up
drop table text_test_1;
drop table text_test_2;
drop table textual_test_1;
drop table textual_test_2;
drop domain textual_test;

-- Best,
--
-- Randall

On Saturday, May 10, 2003, at 06:13 PM, Rod Taylor wrote:

> On Sat, 2003-05-10 at 17:04, Randall Lucas wrote:
>> Hi Folks,
>>
>> If I have a domain defined with an underlying type of "text" or
>> "varchar," and I need to FULL OUTER JOIN two tables based upon the
>> similarity in these fields, I am getting:
>
> Seems it works perfectly fine with integers and text based domains on
> 7.3 and 7.4.  Do you have a full failing example?
>
> junk=# create domain int as integer;
> CREATE DOMAIN
> junk=# create table a (col1 int);
> CREATE TABLE
> junk=# create table b (col1 int);
> CREATE TABLE
> junk=# select * from a full outer join b using (col1);
>  col1
> ------
> (0 rows)
>
> junk=# select version();
>                                 version
> ----------------------------------------------------------------------- 
> -
>  PostgreSQL 7.4devel on i386-unknown-freebsd4.8, compiled by GCC 2.95.4
> (1 row)
>
> -- 
> Rod Taylor <rbt@rbt.ca>
>
> PGP Key: http://www.rbt.ca/rbtpub.asc
> <signature.asc>




view thread (6+ messages)  latest in thread

Message-ID: <D3D5C340-8340-11D7-B164-000A957653D6@tercent.net>
Permalink:  ../D3D5C340-8340-11D7-B164-000A957653D6@tercent.net/
Also on:    postgresql.org/message-id/D3D5C340-8340-11D7-B164-000A957653D6@tercent.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: rlucas@tercent.net, rbt@rbt.ca
  Subject: Re: merge-join for domain with underlying type text
  In-Reply-To: <D3D5C340-8340-11D7-B164-000A957653D6@tercent.net>
  References: <1052604804.48831.19.camel@jester> <D3D5C340-8340-11D7-B164-000A957653D6@tercent.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox