Re: ERROR: c: permission de - Mailing list pgsql-cygwin

From
Subject Re: ERROR: c: permission de
Date
Msg-id 20030902134204.26838.qmail@sina.com
Whole thread Raw
List pgsql-cygwin
Hi, all,
I don't like this syntax:
SELECT * FROM t1 LEFT JOIN t2 ON (t1.num = t2.num);
I prefer:
SELECT * FROM t1, t2 WHERE t1.num *= t2.num; (syntax of Sybase)
or
SELECT * FROM t1, t2 WHERE t1.num(+)= t2.num; (syntax of Oracle)

Because I have many source codes I need to port to PostgreSQL, there are many outer join in the source codes. It's a
tiredjob to rewrite the source codes using the 'LEFT JOIN ... ON' syntax. So I want to write a pair of operators '*='
and'=*' to simulate the behavior of Sybase. 

I don't know how to write a join procedure. I'm not familiar with the source codes of PostgreSQL, so this mission seems
tohard for me. Who can give me some advice? 

I had just started from this code.

outerjoin.sql:
CREATE FUNCTION int_left_outer_join(int, int) RETURNS bool
   AS '/usr/src/postgresql-7.3.4-1/src/tutorial/outerjoin' LANGUAGE 'c';
CREATE FUNCTION int_right_outer_join(int, int) RETURNS bool
   AS '/usr/src/postgresql-7.3.4-1/src/tutorial/outerjoin' LANGUAGE 'c';

CREATE OPERATOR *= (
   leftarg = int,
   rightarg = int,
   procedure = int_left_outer_join,
   join = int_left_outer_join
);
CREATE OPERATOR =* (
   leftarg = int,
   rightarg = int,
   procedure = int_right_outer_join,
   join = int_right_outer_join
);

outerjoin.c:
#include "postgres.h"

bool        int_left_outer_join(int32 * a, int32 * b);
bool        int_right_outer_join(int32 * a, int32 * b);

bool
int_left_outer_join(int32 * a, int32 * b)
{
    return ((NULL == a) || (NULL != a && NULL != b && *a == *b));
}

bool
int_right_outer_join(int32 * a, int32 * b)
{
    return ((NULL == b) || (NULL != a && NULL != b && *a == *b));
}
______________________________________

===================================================================
������ȫ������5�۷ⶥ���Żݼ��������� (http://ad4.sina.com.cn/sina/dangdang0825.html)

pgsql-cygwin by date:

Previous
From: redhat0320
Date:
Subject: Re: ERROR: c: permission de
Next
From: Jason Tishler
Date:
Subject: Updated Cygwin Package: postgresql-7.3.4-2