[PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Hans-Jürgen Schönig
this patch implements CREATE SYNONYM syntax: CREATE SYNONYM [TABLE | INDEX | SEQUENCE | VIEW] synname ON orgname; CREATE SYNONYM FUNCTION synname ON funcname(arg, arg, ...); DROP SYNONYM [TABLE | INDEX | SEQUENCE | VIEW] synname; DROP SYNONYM FUNCTION synname(arg, arg, ...); for

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Michael Glaesemann
On Mar 7, 2006, at 17:29 , Hans-Jürgen Schönig wrote: this patch implements CREATE SYNONYM snip / This feature is especially important to people who want to port from Oracle to PostgreSQL (almost every customer who ports larger Oracle applications will asked for it). Is this SQL spec

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Hans-Jürgen Schönig
this is actually what oracle is doing: http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96540/statements_72a.htm best regards, hans Michael Glaesemann wrote: On Mar 7, 2006, at 17:29 , Hans-Jürgen Schönig wrote: this patch implements CREATE SYNONYM snip

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Tom Lane
Michael Glaesemann [EMAIL PROTECTED] writes: On Mar 7, 2006, at 17:29 , Hans-Jürgen Schönig wrote: this patch implements CREATE SYNONYM Is this SQL spec or Oracle-specific? This is not in the spec. I'm inclined to reject this patch on the grounds that it doesn't do what Oracle does and does

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Jonah H. Harris
On 3/7/06, Tom Lane [EMAIL PROTECTED] wrote: I'm inclined to reject this patch on the grounds that it doesn't dowhat Oracle does and does not look like it could be extended to do whatOracle does.My understanding is that what Oracle people mostly usesynonyms for is to provide cross-database access

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Hans-Jürgen Schönig
hi tom, first of all thank you for looking into this so quickly. Tom Lane wrote: Michael Glaesemann [EMAIL PROTECTED] writes: On Mar 7, 2006, at 17:29 , Hans-Jürgen Schönig wrote: this patch implements CREATE SYNONYM Is this SQL spec or Oracle-specific? This is not in the spec.

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Hans-Jürgen Schönig
I'd be glad to submit my patch and/or cleanup this one if its something the community would be willing to accept. we should definitely work together. what is the status of your patch? maybe we can discuss this off list? thanks, hans -- Cybertec Geschwinde Schönig

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Jonah H. Harris
On 3/7/06, Hans-Jürgen Schönig [EMAIL PROTECTED] wrote: we should definitely work together.what is the status of your patch?maybe we can discuss this off list? The last time I worked on it was on 8.0 (I think), but it wouldn't take much to get it up to speed on 8.2. It's actually very similar to

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Stephan Szabo
On Tue, 7 Mar 2006, [ISO-8859-1] Hans-J?rgen Sch?nig wrote: The semantics of namespace search seem wrong; I would think that a synonym in schema A should mask a table in schema B if A precedes B on the search path, but this doesn't work that way. good point. any other opionions here?

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Stephan Szabo
On Tue, 7 Mar 2006, Jonah H. Harris wrote: On 3/7/06, Stephan Szabo [EMAIL PROTECTED] wrote: I'd personally be more interested in what the impact is on people not using synonyms. How free is any search for synonyms if you aren't using the feature? Unless synonym enablement were a

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Jim C. Nasby
On Tue, Mar 07, 2006 at 12:39:55PM -0800, Stephan Szabo wrote: On Tue, 7 Mar 2006, Jonah H. Harris wrote: On 3/7/06, Stephan Szabo [EMAIL PROTECTED] wrote: I'd personally be more interested in what the impact is on people not using synonyms. How free is any search for synonyms if

[PATCHES] variance aggregates per SQL:2003

2006-03-07 Thread Neil Conway
This patch implements some new aggregate functions defined by SQL2003: stddev_pop(), stddev_samp(), var_pop(), and var_samp(). stddev_samp() and var_samp() are identical to the existing stddev() and variance() aggregates, so I've made the latter aliases for the former. I noticed that SQL2003 does

Re: [PATCHES] variance aggregates per SQL:2003

2006-03-07 Thread David Fetter
On Tue, Mar 07, 2006 at 05:54:00PM -0500, Neil Conway wrote: This patch implements some new aggregate functions defined by SQL2003: stddev_pop(), stddev_samp(), var_pop(), and var_samp(). stddev_samp() and var_samp() are identical to the existing stddev() and variance() aggregates, so I've

Re: [PATCHES] variance aggregates per SQL:2003

2006-03-07 Thread Neil Conway
On Tue, 2006-03-07 at 16:36 -0800, David Fetter wrote: The rationale is kinda mathematical. A measure of deviation from central tendency (i.e. variance or stddev) is something where you probably don't want to normalize the weights. For example, the standard deviation of {0,1,1,1,2} is about

Re: [PATCHES] variance aggregates per SQL:2003

2006-03-07 Thread David Fetter
On Tue, Mar 07, 2006 at 07:56:06PM -0500, Neil Conway wrote: On Tue, 2006-03-07 at 16:36 -0800, David Fetter wrote: The rationale is kinda mathematical. A measure of deviation from central tendency (i.e. variance or stddev) is something where you probably don't want to normalize the

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Jonah H. Harris
On 3/7/06, Tom Lane [EMAIL PROTECTED] wrote: (Actually, I don't think the case for table synonyms has been madeadequately either; Oracle has it is *not* enough reason to take onanother feature that we'll have to maintain forever, especially given that we're being told that one of the major

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Jonah H. Harris
On 3/7/06, Alvaro Herrera [EMAIL PROTECTED] wrote: Tom Lane wrote: (Actually, I don't think the case for table synonyms has been made adequately either; Oracle has it is *not* enough reason to take on another feature that we'll have to maintain forever, especially given that we're being told that

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Alvaro Herrera
Jonah H. Harris wrote: Now, one may argue that it's incorrect/bad application-design to not use fully qualified names, however, there are cases (especially in VERY large database applications) where you do not want to use fully qualified naming. In PostgreSQL, the alternative to synonyms is

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Jonah H. Harris
On 3/7/06, Alvaro Herrera [EMAIL PROTECTED] wrote: Well, if you don't want to have a monstrous search path with 130+schemas, then you'll have a monstrous amount of synonyms.Given thatschemas are a way to separate the object namespace, it seems moresensible to me to propagate the user of reasonable

Re: [PATCHES] variance aggregates per SQL:2003

2006-03-07 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: Well, I realize that stddev(DISTINCT x) != stddev(x) and that most people are going to be interested in stddev(x), but I don't think it's inconceivable for someone to be interested in stddev(DISTINCT x). Explicitly checking for and rejecting it doesn't

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Tom Lane
Jonah H. Harris [EMAIL PROTECTED] writes: Like I said, sometimes the user doesn't have a choice. Sure, it's easy to tell someone that has a 300-line PHP application to fix their code, but I've worked with people who have hundreds of thousands of lines of code and they don't just say, gee,

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Hans-Jürgen Schönig
Stephan Szabo wrote: On Tue, 7 Mar 2006, Jonah H. Harris wrote: On 3/7/06, Stephan Szabo [EMAIL PROTECTED] wrote: I'd personally be more interested in what the impact is on people not using synonyms. How free is any search for synonyms if you aren't using the feature? Unless synonym

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Hans-Jürgen Schönig
One reason I like the alternative of putting synonym entries into the regular catalogs is that it eliminates the need for extra searches: you'd make exactly the same searches as you did before. Now, to the extent that this requires making catalog entries longer, there'd be a distributed overhead

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Hans-Jürgen Schönig
What I don't really understand is what part of this cannot be achieved by changing the search_path. The only case I can think of is when you have tables A and B in schemas R and S, but you want to use R.A and S.B. So there's no way to change search_path for this. But is this really the intended

Re: [PATCHES] CREATE SYNONYM ...

2006-03-07 Thread Stephan Szabo
On Wed, 8 Mar 2006, [ISO-8859-1] Hans-Jürgen Schönig wrote: Stephan Szabo wrote: On Tue, 7 Mar 2006, Jonah H. Harris wrote: On 3/7/06, Stephan Szabo [EMAIL PROTECTED] wrote: I'd personally be more interested in what the impact is on people not using synonyms. How free is any search