pg_replication_origin_xact_reset() and its argument variables

Поиск
Список
Период
Сортировка
Искать

pg_replication_origin_xact_reset() and its argument variables

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
Hi,

The document explains that pg_replication_origin_xact_reset() doesn't have
any argument variables. But it's been actually defined so as to have two
argument variables with pg_lsn and timestamptz data types, as follows.

=# \df pg_replication_origin_xact_reset                                             List of functions  Schema   |               Name               | Result data type |  Argument data types        |  Type
------------+----------------------------------+------------------+----------------------------------+--------pg_catalog | pg_replication_origin_xact_reset | void             |
pg_lsn, timestamp with time zone | normal

As far as I read the code of the function, those arguments don't seem to
be necessary. So I'm afraid that the pg_proc entry for the function might
be incorrect and those two arguments should be removed from the definition.
Is this analysis right?

Regards,

-- 
Fujii Masao


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Fujii Masao  writes:
> The document explains that pg_replication_origin_xact_reset() doesn't have
> any argument variables. But it's been actually defined so as to have two
> argument variables with pg_lsn and timestamptz data types, as follows.

> =# \df pg_replication_origin_xact_reset
>                                               List of functions
>    Schema   |               Name               | Result data type |
>    Argument data types        |  Type
> ------------+----------------------------------+------------------+----------------------------------+--------
>  pg_catalog | pg_replication_origin_xact_reset | void             |
> pg_lsn, timestamp with time zone | normal

> As far as I read the code of the function, those arguments don't seem to
> be necessary. So I'm afraid that the pg_proc entry for the function might
> be incorrect and those two arguments should be removed from the definition.
> Is this analysis right?

Sure looks that way from here.  Copy-and-paste from the previous
line in pg_proc.h, perhaps?
		regards, tom lane


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Andres Freund <andres@anarazel.de>
Дата:
On 2016-06-30 10:14:04 -0400, Tom Lane wrote:
> Fujii Masao  writes:
> > The document explains that pg_replication_origin_xact_reset() doesn't have
> > any argument variables. But it's been actually defined so as to have two
> > argument variables with pg_lsn and timestamptz data types, as follows.
> 
> > =# \df pg_replication_origin_xact_reset
> >                                               List of functions
> >    Schema   |               Name               | Result data type |
> >    Argument data types        |  Type
> > ------------+----------------------------------+------------------+----------------------------------+--------
> >  pg_catalog | pg_replication_origin_xact_reset | void             |
> > pg_lsn, timestamp with time zone | normal
> 
> > As far as I read the code of the function, those arguments don't seem to
> > be necessary. So I'm afraid that the pg_proc entry for the function might
> > be incorrect and those two arguments should be removed from the definition.
> > Is this analysis right?
> 
> Sure looks that way from here.  Copy-and-paste from the previous
> line in pg_proc.h, perhaps?

Yes, that's clearly wrong. Damn.  Can't fix that for 9.5 anymore. The
function isn't all that important (especially not from SQL), but still,
that's annoying.  I'm inclined to just remove the args in 9.6. We could
also add a note to the 9.5 docs, adding that the arguments are there by
error?

Andres


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Andres Freund  writes:
> On 2016-06-30 10:14:04 -0400, Tom Lane wrote:
>> Fujii Masao  writes:
>>> As far as I read the code of the function, those arguments don't seem to
>>> be necessary. So I'm afraid that the pg_proc entry for the function might
>>> be incorrect and those two arguments should be removed from the definition.

>> Sure looks that way from here.  Copy-and-paste from the previous
>> line in pg_proc.h, perhaps?

> Yes, that's clearly wrong. Damn.  Can't fix that for 9.5 anymore. The
> function isn't all that important (especially not from SQL), but still,
> that's annoying.  I'm inclined to just remove the args in 9.6. We could
> also add a note to the 9.5 docs, adding that the arguments are there by
> error?

Yeah, seems like the best thing to do.
		regards, tom lane


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
Вложения:
On Sat, Jul 2, 2016 at 7:01 AM, Tom Lane  wrote:
> Andres Freund  writes:
>> On 2016-06-30 10:14:04 -0400, Tom Lane wrote:
>>> Fujii Masao  writes:
>>>> As far as I read the code of the function, those arguments don't seem to
>>>> be necessary. So I'm afraid that the pg_proc entry for the function might
>>>> be incorrect and those two arguments should be removed from the definition.
>
>>> Sure looks that way from here.  Copy-and-paste from the previous
>>> line in pg_proc.h, perhaps?
>
>> Yes, that's clearly wrong.

Attached patch (pg_replication_origin_xact_reset_9.6.patch) fixes this.
We need to apply this at least before RC1 of PostgreSQL9.6 will be released
because the patch needs the change of catalog version.

>> Damn.  Can't fix that for 9.5 anymore. The
>> function isn't all that important (especially not from SQL), but still,
>> that's annoying.  I'm inclined to just remove the args in 9.6. We could
>> also add a note to the 9.5 docs, adding that the arguments are there by
>> error?

What about the attched patch (pg_replication_origin_xact_reset_9.5.patch)?

Regards,

-- 
Fujii Masao

Re: pg_replication_origin_xact_reset() and its argument variables

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Thu, Jul 28, 2016 at 3:44 AM, Fujii Masao  wrote:
>>>> Sure looks that way from here.  Copy-and-paste from the previous
>>>> line in pg_proc.h, perhaps?
>>
>>> Yes, that's clearly wrong.
>
> Attached patch (pg_replication_origin_xact_reset_9.6.patch) fixes this.
> We need to apply this at least before RC1 of PostgreSQL9.6 will be released
> because the patch needs the change of catalog version.
>
>>> Damn.  Can't fix that for 9.5 anymore. The
>>> function isn't all that important (especially not from SQL), but still,
>>> that's annoying.  I'm inclined to just remove the args in 9.6. We could
>>> also add a note to the 9.5 docs, adding that the arguments are there by
>>> error?
>
> What about the attched patch (pg_replication_origin_xact_reset_9.5.patch)?

I think you should apply these ASAP.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Andres Freund <andres@anarazel.de>
Дата:
On 2016-07-28 16:44:37 +0900, Fujii Masao wrote:
> diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
> index d6ed0ce..0a3d3de 100644
> --- a/doc/src/sgml/func.sgml
> +++ b/doc/src/sgml/func.sgml
> @@ -17519,7 +17519,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
>          
>           pg_replication_origin_xact_reset
>          
> -        pg_replication_origin_xact_reset()
> +        pg_replication_origin_xact_reset(origin_lsn pg_lsn, origin_timestamp timestamptz)
>         
>         
>          void
> @@ -17527,6 +17527,12 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
>         
>          Cancel the effects of
>          pg_replication_origin_xact_setup().
> +        Note that two arguments were introduced by mistake</>
> +        during the PostgreSQL</> 9.5 development cycle while
> +        pg_replication_origin_xact_reset() actually
> +        doesn't use them at all. Therefore, any dummy values like
> +        NULL</> can be safely specified as the arguments.
> +        This mistake will be fixed in a future release.
>         
>        

I don't think NULL works, the function is marked as strict. Otherwise
that looks right.

Thanks,

Andres


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Andres Freund <andres@anarazel.de>
Дата:
Hi Fujii,

On 2016-07-28 16:44:37 +0900, Fujii Masao wrote:
> On Sat, Jul 2, 2016 at 7:01 AM, Tom Lane  wrote:
> > Andres Freund  writes:
> >> On 2016-06-30 10:14:04 -0400, Tom Lane wrote:
> >>> Fujii Masao  writes:
> >>>> As far as I read the code of the function, those arguments don't seem to
> >>>> be necessary. So I'm afraid that the pg_proc entry for the function might
> >>>> be incorrect and those two arguments should be removed from the definition.
> >
> >>> Sure looks that way from here.  Copy-and-paste from the previous
> >>> line in pg_proc.h, perhaps?
> >
> >> Yes, that's clearly wrong.
> 
> Attached patch (pg_replication_origin_xact_reset_9.6.patch) fixes this.
> We need to apply this at least before RC1 of PostgreSQL9.6 will be released
> because the patch needs the change of catalog version.
> 
> >> Damn.  Can't fix that for 9.5 anymore. The
> >> function isn't all that important (especially not from SQL), but still,
> >> that's annoying.  I'm inclined to just remove the args in 9.6. We could
> >> also add a note to the 9.5 docs, adding that the arguments are there by
> >> error?
> 
> What about the attched patch (pg_replication_origin_xact_reset_9.5.patch)?

except for the strictness remark in the other email, these look sane to
me.  Do you want to push them?  I'll do so by Wednesday otherwise, to
leave some room before the next RC.

Greetings,

Andres Freund


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Tue, Aug 2, 2016 at 2:48 AM, Andres Freund  wrote:
> Hi Fujii,
>
> On 2016-07-28 16:44:37 +0900, Fujii Masao wrote:
>> On Sat, Jul 2, 2016 at 7:01 AM, Tom Lane  wrote:
>> > Andres Freund  writes:
>> >> On 2016-06-30 10:14:04 -0400, Tom Lane wrote:
>> >>> Fujii Masao  writes:
>> >>>> As far as I read the code of the function, those arguments don't seem to
>> >>>> be necessary. So I'm afraid that the pg_proc entry for the function might
>> >>>> be incorrect and those two arguments should be removed from the definition.
>> >
>> >>> Sure looks that way from here.  Copy-and-paste from the previous
>> >>> line in pg_proc.h, perhaps?
>> >
>> >> Yes, that's clearly wrong.
>>
>> Attached patch (pg_replication_origin_xact_reset_9.6.patch) fixes this.
>> We need to apply this at least before RC1 of PostgreSQL9.6 will be released
>> because the patch needs the change of catalog version.
>>
>> >> Damn.  Can't fix that for 9.5 anymore. The
>> >> function isn't all that important (especially not from SQL), but still,
>> >> that's annoying.  I'm inclined to just remove the args in 9.6. We could
>> >> also add a note to the 9.5 docs, adding that the arguments are there by
>> >> error?
>>
>> What about the attched patch (pg_replication_origin_xact_reset_9.5.patch)?
>
> except for the strictness remark in the other email,

Yes, you're right. My careless mistake... :(

> these look sane to
> me.  Do you want to push them?  I'll do so by Wednesday otherwise, to
> leave some room before the next RC.

Could you do that if possible?

Regards,

-- 
Fujii Masao


Re: pg_replication_origin_xact_reset() and its argument variables

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Tue, Aug 2, 2016 at 2:59 AM, Fujii Masao  wrote:
> On Tue, Aug 2, 2016 at 2:48 AM, Andres Freund  wrote:
>> Hi Fujii,
>>
>> On 2016-07-28 16:44:37 +0900, Fujii Masao wrote:
>>> On Sat, Jul 2, 2016 at 7:01 AM, Tom Lane  wrote:
>>> > Andres Freund  writes:
>>> >> On 2016-06-30 10:14:04 -0400, Tom Lane wrote:
>>> >>> Fujii Masao  writes:
>>> >>>> As far as I read the code of the function, those arguments don't seem to
>>> >>>> be necessary. So I'm afraid that the pg_proc entry for the function might
>>> >>>> be incorrect and those two arguments should be removed from the definition.
>>> >
>>> >>> Sure looks that way from here.  Copy-and-paste from the previous
>>> >>> line in pg_proc.h, perhaps?
>>> >
>>> >> Yes, that's clearly wrong.
>>>
>>> Attached patch (pg_replication_origin_xact_reset_9.6.patch) fixes this.
>>> We need to apply this at least before RC1 of PostgreSQL9.6 will be released
>>> because the patch needs the change of catalog version.
>>>
>>> >> Damn.  Can't fix that for 9.5 anymore. The
>>> >> function isn't all that important (especially not from SQL), but still,
>>> >> that's annoying.  I'm inclined to just remove the args in 9.6. We could
>>> >> also add a note to the 9.5 docs, adding that the arguments are there by
>>> >> error?
>>>
>>> What about the attched patch (pg_replication_origin_xact_reset_9.5.patch)?
>>
>> except for the strictness remark in the other email,
>
> Yes, you're right. My careless mistake... :(
>
>> these look sane to
>> me.  Do you want to push them?  I'll do so by Wednesday otherwise, to
>> leave some room before the next RC.
>
> Could you do that if possible?

Pushed since right now I have time to do that. Anyway, thanks!

Regards,

-- 
Fujii Masao


FAQ