Re: PostgreSQL vs SQL/XML Standards

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: Markus Winand <markus(dot)winand(at)winand(dot)at>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL vs SQL/XML Standards
Date: 2018-12-31 06:03:05
Message-ID: CAFj8pRCN=0k507nTfvNQuruHvomA4SiC6uGUXY5Gz0crxf-JAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

po 31. 12. 2018 v 3:15 odesílatel Chapman Flack <chap(at)anastigmatix(dot)net>
napsal:

> On 12/30/18 15:18, Pavel Stehule wrote:
> > ne 30. 12. 2018 v 20:06 odesílatel Chapman Flack <chap(at)anastigmatix(dot)net>
> > napsal:
> >> How difficult would it be to make the grammar constructs that currently
> >> accept "BY REF" (only as noise and ignore it) accept and ignore both BY
> REF
> >> and BY VALUE?
> >
> > This is difficult question - a implementation is probably very easy, but
> it
> > is hard to accept to possible break compatibility due syntactic sugar.
> >
> > This is not probably related to just XPath/XQuery question - but it is
> > related to different design of XML datatype (based on PostgreSQL TOAST)
> > against ANSI/SQL (Oracle - clob).
> >
> > So this is complicated topic and my opinion is better to don't touch it
> > because we can't to fix it, change it - and I am not sure so ANSI/SQL is
> > significantly better than PostgreSQL implementation.
>
> I am not sure I understand your point. It appears that Oracle (18c),
> just like PostgreSQL, really only supports BY VALUE semantics. Here is
> an Oracle fiddle that shows it:
>
>
> https://dbfiddle.uk/?rdbms=oracle_18&fiddle=0cb353da0d94c6d5c2659222a1e419fd
>
> When the same element is passed via two parameters, an 'is' test (node
> identity equality) of the two parameters returns false, indicating that
> Oracle has used BY VALUE semantics, not BY REF.
>
> Oracle uses BY VALUE when BY VALUE is explicitly requested, and also when
> no passing method is specified (i.e., BY VALUE is the default). Oracle also
> uses BY VALUE when BY REF is explicitly requested, which seems rather rude,
> but that must be the behavior PostgreSQL is imitating with the choice to
> accept and ignore BY REF.
>
> But the PostgreSQL situation is a little more strange. PG uses BY VALUE
> semantics as the default when no passing method is specified. PG also uses
> BY VALUE semantics when BY REF is explicitly requested, which is rude,
> just like Oracle. But why should an explicit specification of BY VALUE
> (which is, after all, the semantics we're going to use anyway!) produce
> this?
>
> ERROR: syntax error at or near "value"
>
> To me, that doesn't seem like least astonishment.
>
> I am not seeing what would be complicated about removing that astonishment
> by simply allowing the grammar productions to also consume BY VALUE and
> ignore it.
>

ok - I am not against implementation of ignored BY VALUE. But I don't like
a idea to disable BY REF.

Regards

Pavel

>
> -Chap
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-12-31 08:07:47 Re: Clean up some elog messages and comments for do_pg_stop_backup and do_pg_start_backup
Previous Message Surafel Temesgen 2018-12-31 05:57:59 Re: pg_dump multi VALUES INSERT