Re: proposal: enable new error fields in plpgsql (9.4)

Lists: pgsql-hackers
From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-02-01 12:47:41
Message-ID: CAFj8pRC80Xc+Qf5HZuzCQFDBMXOFLXZzn9UMXa7GQCm3OHtL+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

now a most "hard" work is done and I would to enable access to new
error fields from plpgsql.

these new fields are column_name, constraint_name, datatype_name,
table_name and schema_name.

This proposal has impact on two plpgsql statements - RAISE and GET
STACKED DIAGNOSTICS.

I am sending initial implementation

Comments, notes?

Regards

Pavel

Attachment Content-Type Size
enhanced_error_fields_plpgsql_initial.patch application/octet-stream 20.2 KB

From: Marko Tiikkaja <pgmail(at)joh(dot)to>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-02-01 12:52:23
Message-ID: 510BBA87.1010405@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2/1/13 1:47 PM, Pavel Stehule wrote:
> now a most "hard" work is done and I would to enable access to new
> error fields from plpgsql.

Is there a compelling reason why we wouldn't provide these already in 9.3?

Regards,
Marko Tiikkaja


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Marko Tiikkaja <pgmail(at)joh(dot)to>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-02-01 13:00:30
Message-ID: CAFj8pRDAna_SjvJHBh759L++NNBQ9MTfgBYFcKcVxE9v_57S2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
> On 2/1/13 1:47 PM, Pavel Stehule wrote:
>>
>> now a most "hard" work is done and I would to enable access to new
>> error fields from plpgsql.
>
>
> Is there a compelling reason why we wouldn't provide these already in 9.3?

a time for assign to last commitfest is out.

this patch is relative simple and really close to enhanced error
fields feature - but depends if some from commiters will have a time
for commit to 9.3 - so I am expecting primary target 9.4, but I am not
be angry if it will be commited early.

Regards

Pavel

>
>
>
> Regards,
> Marko Tiikkaja


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-02-01 13:43:37
Message-ID: 510BC689.2080902@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2/1/13 8:00 AM, Pavel Stehule wrote:
> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
>>>
>>> now a most "hard" work is done and I would to enable access to new
>>> error fields from plpgsql.
>>
>>
>> Is there a compelling reason why we wouldn't provide these already in 9.3?
>
> a time for assign to last commitfest is out.
>
> this patch is relative simple and really close to enhanced error
> fields feature - but depends if some from commiters will have a time
> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
> be angry if it will be commited early.

If we don't have access to those fields on PL/pgSQL, what was the point
of the patch to begin with? Surely, accessing them from C wasn't the
main use case?


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-02-01 13:51:32
Message-ID: CAFj8pRBzDcvjkj5Z850qw92srqGkJudGW=rYJxqtUVULu7Vs=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> On 2/1/13 8:00 AM, Pavel Stehule wrote:
>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
>>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
>>>>
>>>> now a most "hard" work is done and I would to enable access to new
>>>> error fields from plpgsql.
>>>
>>>
>>> Is there a compelling reason why we wouldn't provide these already in 9.3?
>>
>> a time for assign to last commitfest is out.
>>
>> this patch is relative simple and really close to enhanced error
>> fields feature - but depends if some from commiters will have a time
>> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
>> be angry if it will be commited early.
>
> If we don't have access to those fields on PL/pgSQL, what was the point
> of the patch to begin with? Surely, accessing them from C wasn't the
> main use case?
>

These fields are available for application developers now. But is a
true, so without this patch, GET STACKED DIAGNOSTICS statement will
not be fully consistent, because some fields are accessible and others
not

Pavel


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-02-01 13:59:25
Message-ID: CAFj8pRDz9is9VKBoycV9TiRW_r9No2M_3zmTQFZcjWobVmbJzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
>> On 2/1/13 8:00 AM, Pavel Stehule wrote:
>>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
>>>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
>>>>>
>>>>> now a most "hard" work is done and I would to enable access to new
>>>>> error fields from plpgsql.
>>>>
>>>>
>>>> Is there a compelling reason why we wouldn't provide these already in 9.3?
>>>
>>> a time for assign to last commitfest is out.
>>>
>>> this patch is relative simple and really close to enhanced error
>>> fields feature - but depends if some from commiters will have a time
>>> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
>>> be angry if it will be commited early.
>>
>> If we don't have access to those fields on PL/pgSQL, what was the point
>> of the patch to begin with? Surely, accessing them from C wasn't the
>> main use case?
>>
>
> These fields are available for application developers now. But is a
> true, so without this patch, GET STACKED DIAGNOSTICS statement will
> not be fully consistent, because some fields are accessible and others
> not

there is one stronger argument for commit this patch now. With this
patch, we are able to wrote regression tests for new fields via
plpgsql.

Regards

Pavel

>
> Pavel


From: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-25 09:02:20
Message-ID: CAGPqQf16bQTq_O8TVBG5HQyXGamiCLXEY5zJRqDJ6cf6VRchWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi Pavel,

I gone through the discussion over here and found that with this patch we
enable the new error fields in plpgsql. Its a simple patch to expose the new
error fields in plpgsql.

Patch gets applied cleanly. make and make install too went smooth. make
check
was smooth too. Patch also include test coverage

I tested the functionality with manual test and its woking as expected.

BTW in the patch I found one additional new like in read_raise_options():

@@ -3631,7 +3661,23 @@ read_raise_options(void)
else if (tok_is_keyword(tok, &yylval,
K_HINT,
"hint"))
opt->opt_type = PLPGSQL_RAISEOPTION_HINT;
+ else if (tok_is_keyword(tok, &yylval,
+
K_COLUMN_NAME, "column_name"))
+ opt->opt_type = PLPGSQL_RAISEOPTION_COLUMN_NAME;
+ else if (tok_is_keyword(tok, &yylval,
+
K_CONSTRAINT_NAME, "constraint_name"))
+ opt->opt_type = PLPGSQL_RAISEOPTION_CONSTRAINT_NAME;
+ else if (tok_is_keyword(tok, &yylval,
+
K_DATATYPE_NAME, "datatype_name"))
+ opt->opt_type = PLPGSQL_RAISEOPTION_DATATYPE_NAME;
+ else if (tok_is_keyword(tok, &yylval,
+
K_TABLE_NAME, "table_name"))
+ opt->opt_type = PLPGSQL_RAISEOPTION_TABLE_NAME;
+ else if (tok_is_keyword(tok, &yylval,
+
K_SCHEMA_NAME, "schema_name"))
+ opt->opt_type = PLPGSQL_RAISEOPTION_SCHEMA_NAME;
else
+
yyerror("unrecognized RAISE statement option");

can you please remove that.

Apart from that patch looks good to me.

Thanks,
Rushabh

On Fri, Feb 1, 2013 at 7:29 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:

> 2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> > 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> >> On 2/1/13 8:00 AM, Pavel Stehule wrote:
> >>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
> >>>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
> >>>>>
> >>>>> now a most "hard" work is done and I would to enable access to new
> >>>>> error fields from plpgsql.
> >>>>
> >>>>
> >>>> Is there a compelling reason why we wouldn't provide these already in
> 9.3?
> >>>
> >>> a time for assign to last commitfest is out.
> >>>
> >>> this patch is relative simple and really close to enhanced error
> >>> fields feature - but depends if some from commiters will have a time
> >>> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
> >>> be angry if it will be commited early.
> >>
> >> If we don't have access to those fields on PL/pgSQL, what was the point
> >> of the patch to begin with? Surely, accessing them from C wasn't the
> >> main use case?
> >>
> >
> > These fields are available for application developers now. But is a
> > true, so without this patch, GET STACKED DIAGNOSTICS statement will
> > not be fully consistent, because some fields are accessible and others
> > not
>
> there is one stronger argument for commit this patch now. With this
> patch, we are able to wrote regression tests for new fields via
> plpgsql.
>
> Regards
>
> Pavel
>
> >
> > Pavel
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

--
Rushabh Lathia


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-25 09:11:58
Message-ID: CAFj8pRBu+M1DKDMopQJuy2bUpYLjmpHTPhbSUMqC6nefW0eYjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/6/25 Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>:
> Hi Pavel,
>
> I gone through the discussion over here and found that with this patch we
> enable the new error fields in plpgsql. Its a simple patch to expose the new
> error fields in plpgsql.
>
> Patch gets applied cleanly. make and make install too went smooth. make
> check
> was smooth too. Patch also include test coverage
>
> I tested the functionality with manual test and its woking as expected.
>
> BTW in the patch I found one additional new like in read_raise_options():
>
> @@ -3631,7 +3661,23 @@ read_raise_options(void)
> else if (tok_is_keyword(tok, &yylval,
> K_HINT,
> "hint"))
> opt->opt_type = PLPGSQL_RAISEOPTION_HINT;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_COLUMN_NAME, "column_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_COLUMN_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_CONSTRAINT_NAME, "constraint_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_CONSTRAINT_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_DATATYPE_NAME, "datatype_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_DATATYPE_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_TABLE_NAME, "table_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_TABLE_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_SCHEMA_NAME, "schema_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_SCHEMA_NAME;
> else
> +
> yyerror("unrecognized RAISE statement option");
>
> can you please remove that.

No, these fields are there as was proposed - it enhance possibilities
to PLpgSQL developers - they can use these fields for custom
exceptions. It is same like possibility to specify SQLCODE, MESSAGE,
HINT in current RAISE statement implementation.

Why you dislike it?

Regards

Pavel

>
> Apart from that patch looks good to me.
>
> Thanks,
> Rushabh
>
>
> On Fri, Feb 1, 2013 at 7:29 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>>
>> 2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>> > 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
>> >> On 2/1/13 8:00 AM, Pavel Stehule wrote:
>> >>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
>> >>>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
>> >>>>>
>> >>>>> now a most "hard" work is done and I would to enable access to new
>> >>>>> error fields from plpgsql.
>> >>>>
>> >>>>
>> >>>> Is there a compelling reason why we wouldn't provide these already in
>> >>>> 9.3?
>> >>>
>> >>> a time for assign to last commitfest is out.
>> >>>
>> >>> this patch is relative simple and really close to enhanced error
>> >>> fields feature - but depends if some from commiters will have a time
>> >>> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
>> >>> be angry if it will be commited early.
>> >>
>> >> If we don't have access to those fields on PL/pgSQL, what was the point
>> >> of the patch to begin with? Surely, accessing them from C wasn't the
>> >> main use case?
>> >>
>> >
>> > These fields are available for application developers now. But is a
>> > true, so without this patch, GET STACKED DIAGNOSTICS statement will
>> > not be fully consistent, because some fields are accessible and others
>> > not
>>
>> there is one stronger argument for commit this patch now. With this
>> patch, we are able to wrote regression tests for new fields via
>> plpgsql.
>>
>> Regards
>>
>> Pavel
>>
>> >
>> > Pavel
>>
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
>
>
>
> --
> Rushabh Lathia


From: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-25 09:24:05
Message-ID: CAGPqQf2hgqNtf8BENNA1SC7KVOAR-7T8GXq6iG_1tFL9ws7Wzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 25, 2013 at 2:41 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:

> 2013/6/25 Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>:
> > Hi Pavel,
> >
> > I gone through the discussion over here and found that with this patch we
> > enable the new error fields in plpgsql. Its a simple patch to expose the
> new
> > error fields in plpgsql.
> >
> > Patch gets applied cleanly. make and make install too went smooth. make
> > check
> > was smooth too. Patch also include test coverage
> >
> > I tested the functionality with manual test and its woking as expected.
> >
> > BTW in the patch I found one additional new like in read_raise_options():
> >
> > @@ -3631,7 +3661,23 @@ read_raise_options(void)
> > else if (tok_is_keyword(tok, &yylval,
> > K_HINT,
> > "hint"))
> > opt->opt_type = PLPGSQL_RAISEOPTION_HINT;
> > + else if (tok_is_keyword(tok, &yylval,
> > +
> > K_COLUMN_NAME, "column_name"))
> > + opt->opt_type = PLPGSQL_RAISEOPTION_COLUMN_NAME;
> > + else if (tok_is_keyword(tok, &yylval,
> > +
> > K_CONSTRAINT_NAME, "constraint_name"))
> > + opt->opt_type =
> PLPGSQL_RAISEOPTION_CONSTRAINT_NAME;
> > + else if (tok_is_keyword(tok, &yylval,
> > +
> > K_DATATYPE_NAME, "datatype_name"))
> > + opt->opt_type =
> PLPGSQL_RAISEOPTION_DATATYPE_NAME;
> > + else if (tok_is_keyword(tok, &yylval,
> > +
> > K_TABLE_NAME, "table_name"))
> > + opt->opt_type = PLPGSQL_RAISEOPTION_TABLE_NAME;
> > + else if (tok_is_keyword(tok, &yylval,
> > +
> > K_SCHEMA_NAME, "schema_name"))
> > + opt->opt_type = PLPGSQL_RAISEOPTION_SCHEMA_NAME;
> > else
> > +
> > yyerror("unrecognized RAISE statement option");
> >
> > can you please remove that.
>
> No, these fields are there as was proposed - it enhance possibilities
> to PLpgSQL developers - they can use these fields for custom
> exceptions. It is same like possibility to specify SQLCODE, MESSAGE,
> HINT in current RAISE statement implementation.
>
> Why you dislike it?
>

Seems like some confusion.

I noticed additional new line which has been added into your patch in
function
read_raise_options()::pl_gram.y @ line number 3680. And in the earlier mail
thats what I asked to remove.

> Regards
>
> Pavel
>
> >
> > Apart from that patch looks good to me.
> >
> > Thanks,
> > Rushabh
> >
> >
> > On Fri, Feb 1, 2013 at 7:29 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> > wrote:
> >>
> >> 2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> >> > 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> >> >> On 2/1/13 8:00 AM, Pavel Stehule wrote:
> >> >>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
> >> >>>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
> >> >>>>>
> >> >>>>> now a most "hard" work is done and I would to enable access to new
> >> >>>>> error fields from plpgsql.
> >> >>>>
> >> >>>>
> >> >>>> Is there a compelling reason why we wouldn't provide these already
> in
> >> >>>> 9.3?
> >> >>>
> >> >>> a time for assign to last commitfest is out.
> >> >>>
> >> >>> this patch is relative simple and really close to enhanced error
> >> >>> fields feature - but depends if some from commiters will have a time
> >> >>> for commit to 9.3 - so I am expecting primary target 9.4, but I am
> not
> >> >>> be angry if it will be commited early.
> >> >>
> >> >> If we don't have access to those fields on PL/pgSQL, what was the
> point
> >> >> of the patch to begin with? Surely, accessing them from C wasn't the
> >> >> main use case?
> >> >>
> >> >
> >> > These fields are available for application developers now. But is a
> >> > true, so without this patch, GET STACKED DIAGNOSTICS statement will
> >> > not be fully consistent, because some fields are accessible and others
> >> > not
> >>
> >> there is one stronger argument for commit this patch now. With this
> >> patch, we are able to wrote regression tests for new fields via
> >> plpgsql.
> >>
> >> Regards
> >>
> >> Pavel
> >>
> >> >
> >> > Pavel
> >>
> >>
> >> --
> >> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> >> To make changes to your subscription:
> >> http://www.postgresql.org/mailpref/pgsql-hackers
> >
> >
> >
> >
> > --
> > Rushabh Lathia
>

--
Rushabh Lathia


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-25 10:01:37
Message-ID: CAFj8pRA8M8VwSMzbwTWTzuo6WFESmMGQtUQdeFXKd3Qds5Ec-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/6/25 Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>:
>
>
>
> On Tue, Jun 25, 2013 at 2:41 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>>
>> 2013/6/25 Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>:
>> > Hi Pavel,
>> >
>> > I gone through the discussion over here and found that with this patch
>> > we
>> > enable the new error fields in plpgsql. Its a simple patch to expose the
>> > new
>> > error fields in plpgsql.
>> >
>> > Patch gets applied cleanly. make and make install too went smooth. make
>> > check
>> > was smooth too. Patch also include test coverage
>> >
>> > I tested the functionality with manual test and its woking as expected.
>> >
>> > BTW in the patch I found one additional new like in
>> > read_raise_options():
>> >
>> > @@ -3631,7 +3661,23 @@ read_raise_options(void)
>> > else if (tok_is_keyword(tok, &yylval,
>> > K_HINT,
>> > "hint"))
>> > opt->opt_type = PLPGSQL_RAISEOPTION_HINT;
>> > + else if (tok_is_keyword(tok, &yylval,
>> > +
>> > K_COLUMN_NAME, "column_name"))
>> > + opt->opt_type = PLPGSQL_RAISEOPTION_COLUMN_NAME;
>> > + else if (tok_is_keyword(tok, &yylval,
>> > +
>> > K_CONSTRAINT_NAME, "constraint_name"))
>> > + opt->opt_type =
>> > PLPGSQL_RAISEOPTION_CONSTRAINT_NAME;
>> > + else if (tok_is_keyword(tok, &yylval,
>> > +
>> > K_DATATYPE_NAME, "datatype_name"))
>> > + opt->opt_type =
>> > PLPGSQL_RAISEOPTION_DATATYPE_NAME;
>> > + else if (tok_is_keyword(tok, &yylval,
>> > +
>> > K_TABLE_NAME, "table_name"))
>> > + opt->opt_type = PLPGSQL_RAISEOPTION_TABLE_NAME;
>> > + else if (tok_is_keyword(tok, &yylval,
>> > +
>> > K_SCHEMA_NAME, "schema_name"))
>> > + opt->opt_type = PLPGSQL_RAISEOPTION_SCHEMA_NAME;
>> > else
>> > +
>> > yyerror("unrecognized RAISE statement option");
>> >
>> > can you please remove that.
>>
>> No, these fields are there as was proposed - it enhance possibilities
>> to PLpgSQL developers - they can use these fields for custom
>> exceptions. It is same like possibility to specify SQLCODE, MESSAGE,
>> HINT in current RAISE statement implementation.
>>
>> Why you dislike it?
>
>
> Seems like some confusion.
>
> I noticed additional new line which has been added into your patch in
> function
> read_raise_options()::pl_gram.y @ line number 3680. And in the earlier mail
> thats what I asked to remove.
>
I am sorry

I remove these new lines

Regards

Pavel
>
>
>>
>> Regards
>>
>> Pavel
>>
>> >
>> > Apart from that patch looks good to me.
>> >
>> > Thanks,
>> > Rushabh
>> >
>> >
>> > On Fri, Feb 1, 2013 at 7:29 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>> > wrote:
>> >>
>> >> 2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>> >> > 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
>> >> >> On 2/1/13 8:00 AM, Pavel Stehule wrote:
>> >> >>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
>> >> >>>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
>> >> >>>>>
>> >> >>>>> now a most "hard" work is done and I would to enable access to
>> >> >>>>> new
>> >> >>>>> error fields from plpgsql.
>> >> >>>>
>> >> >>>>
>> >> >>>> Is there a compelling reason why we wouldn't provide these already
>> >> >>>> in
>> >> >>>> 9.3?
>> >> >>>
>> >> >>> a time for assign to last commitfest is out.
>> >> >>>
>> >> >>> this patch is relative simple and really close to enhanced error
>> >> >>> fields feature - but depends if some from commiters will have a
>> >> >>> time
>> >> >>> for commit to 9.3 - so I am expecting primary target 9.4, but I am
>> >> >>> not
>> >> >>> be angry if it will be commited early.
>> >> >>
>> >> >> If we don't have access to those fields on PL/pgSQL, what was the
>> >> >> point
>> >> >> of the patch to begin with? Surely, accessing them from C wasn't
>> >> >> the
>> >> >> main use case?
>> >> >>
>> >> >
>> >> > These fields are available for application developers now. But is a
>> >> > true, so without this patch, GET STACKED DIAGNOSTICS statement will
>> >> > not be fully consistent, because some fields are accessible and
>> >> > others
>> >> > not
>> >>
>> >> there is one stronger argument for commit this patch now. With this
>> >> patch, we are able to wrote regression tests for new fields via
>> >> plpgsql.
>> >>
>> >> Regards
>> >>
>> >> Pavel
>> >>
>> >> >
>> >> > Pavel
>> >>
>> >>
>> >> --
>> >> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> >> To make changes to your subscription:
>> >> http://www.postgresql.org/mailpref/pgsql-hackers
>> >
>> >
>> >
>> >
>> > --
>> > Rushabh Lathia
>
>
>
>
> --
> Rushabh Lathia


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-25 13:56:27
Message-ID: CAFj8pRA+ePUkrFO4zDDgisus9CrUmOB92nJhzB6bDcOdRAJQGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

2013/6/25 Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>:
> Hi Pavel,
>
> I gone through the discussion over here and found that with this patch we
> enable the new error fields in plpgsql. Its a simple patch to expose the new
> error fields in plpgsql.
>
> Patch gets applied cleanly. make and make install too went smooth. make
> check
> was smooth too. Patch also include test coverage
>
> I tested the functionality with manual test and its woking as expected.
>
> BTW in the patch I found one additional new like in read_raise_options():
>
> @@ -3631,7 +3661,23 @@ read_raise_options(void)
> else if (tok_is_keyword(tok, &yylval,
> K_HINT,
> "hint"))
> opt->opt_type = PLPGSQL_RAISEOPTION_HINT;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_COLUMN_NAME, "column_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_COLUMN_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_CONSTRAINT_NAME, "constraint_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_CONSTRAINT_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_DATATYPE_NAME, "datatype_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_DATATYPE_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_TABLE_NAME, "table_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_TABLE_NAME;
> + else if (tok_is_keyword(tok, &yylval,
> +
> K_SCHEMA_NAME, "schema_name"))
> + opt->opt_type = PLPGSQL_RAISEOPTION_SCHEMA_NAME;
> else
> +
> yyerror("unrecognized RAISE statement option");
>
> can you please remove that.

cleaned patch is in attachment

>
> Apart from that patch looks good to me.

:) thank you for review

Regards

Pavel Stehule

>
> Thanks,
> Rushabh
>
>
> On Fri, Feb 1, 2013 at 7:29 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>>
>> 2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>> > 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
>> >> On 2/1/13 8:00 AM, Pavel Stehule wrote:
>> >>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
>> >>>> On 2/1/13 1:47 PM, Pavel Stehule wrote:
>> >>>>>
>> >>>>> now a most "hard" work is done and I would to enable access to new
>> >>>>> error fields from plpgsql.
>> >>>>
>> >>>>
>> >>>> Is there a compelling reason why we wouldn't provide these already in
>> >>>> 9.3?
>> >>>
>> >>> a time for assign to last commitfest is out.
>> >>>
>> >>> this patch is relative simple and really close to enhanced error
>> >>> fields feature - but depends if some from commiters will have a time
>> >>> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
>> >>> be angry if it will be commited early.
>> >>
>> >> If we don't have access to those fields on PL/pgSQL, what was the point
>> >> of the patch to begin with? Surely, accessing them from C wasn't the
>> >> main use case?
>> >>
>> >
>> > These fields are available for application developers now. But is a
>> > true, so without this patch, GET STACKED DIAGNOSTICS statement will
>> > not be fully consistent, because some fields are accessible and others
>> > not
>>
>> there is one stronger argument for commit this patch now. With this
>> patch, we are able to wrote regression tests for new fields via
>> plpgsql.
>>
>> Regards
>>
>> Pavel
>>
>> >
>> > Pavel
>>
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
>
>
>
> --
> Rushabh Lathia

Attachment Content-Type Size
enhanced_error_fields_plpgsql.patch application/octet-stream 20.2 KB

From: Noah Misch <noah(at)leadboat(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-27 22:35:20
Message-ID: 20130627223520.GA919545@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 25, 2013 at 03:56:27PM +0200, Pavel Stehule wrote:
> cleaned patch is in attachment

Of the five options you're adding to GET STACKED DIAGNOSTICS, four of them
appear in the SQL standard. DATATYPE_NAME does not; I think we should call it
PG_DATATYPE_NAME in line with our other extensions in this area.

> >> 2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> >> > 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> >> >> On 2/1/13 8:00 AM, Pavel Stehule wrote:
> >> >>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
> >> >>>> Is there a compelling reason why we wouldn't provide these already in
> >> >>>> 9.3?
> >> >>>
> >> >>> a time for assign to last commitfest is out.
> >> >>>
> >> >>> this patch is relative simple and really close to enhanced error
> >> >>> fields feature - but depends if some from commiters will have a time
> >> >>> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
> >> >>> be angry if it will be commited early.
> >> >>
> >> >> If we don't have access to those fields on PL/pgSQL, what was the point
> >> >> of the patch to begin with? Surely, accessing them from C wasn't the
> >> >> main use case?
> >> >>
> >> >
> >> > These fields are available for application developers now. But is a
> >> > true, so without this patch, GET STACKED DIAGNOSTICS statement will
> >> > not be fully consistent, because some fields are accessible and others
> >> > not

I am inclined to back-patch this to 9.3. The patch is fairly mechanical, and
I think the risk of introducing bugs is less than the risk that folks will be
confused by these new-in-9.3 error fields being accessible from libpq and the
protocol, yet inaccessible from PL/pgSQL.

The existing protocol documentation says things like this:

Table name: if the error was associated with a specific table, the
name of the table. (When this field is present, the schema name field
provides the name of the table's schema.)

The way you have defined RAISE does not enforce this; the user can set
TABLE_NAME without setting SCHEMA_NAME at all. I see a few options here:

1. Change RAISE to check the invariants thoroughly. For example, TABLE_NAME
would require SCHEMA name, and the pair would need to name an actual table.

2. Change RAISE to check the invariants simply. For example, it could check
that SCHEMA_NAME is present whenever TABLE_NAME is present but provide no
validation that the pair names an actual table. (I think the protocol
language basically allows this, though a brief note wouldn't hurt.)

3. Tweak the protocol documentation to clearly permit what the patch has RAISE
allow, namely the free-form use of these fields. This part of the protocol is
new in 9.3, so it won't be a big deal to change it. The libpq documentation
has similar verbiage to update.

I suppose I prefer #3. It seems fair for user code to employ these fields for
applications slightly broader than their core use, like a constraint name that
represents some userspace notion of a constraint rather than normal, cataloged
constraint. I can also imagine an application like replaying logs from
another server, recreating the messages as that server emitted them; #2 or #3
would suffice for that.

Looking beyond the immediate topic of PL/pgSQL, it seems fair for a FDW to use
these error fields to name remote objects not known locally. Suppose a
foreign INSERT fires a remote trigger, and that trigger violates a constraint
of some other remote table. Naming the remote objects would be a reasonable
design choice. postgres_fdw might have chosen to just copy fields from the
remote error (it does not do this today for the fields in question, though).
The FDW might not even have a notion of a schema, at which point it would
legitimately choose to leave that field unpopulated. Once we allow any part
of the system to generate such errors, we should let PL/pgSQL do the same.

Thoughts on that plan?

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-28 05:49:46
Message-ID: CAFj8pRCRJgpw-5YvHR2Ee1pom-REHx2cLvDWAmgRnJyktzE5jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> On Tue, Jun 25, 2013 at 03:56:27PM +0200, Pavel Stehule wrote:
>> cleaned patch is in attachment
>
> Of the five options you're adding to GET STACKED DIAGNOSTICS, four of them
> appear in the SQL standard. DATATYPE_NAME does not; I think we should call it
> PG_DATATYPE_NAME in line with our other extensions in this area.
>

yes, but It should be fixed in 9.3 enhanced fields too - it should be
consistent with PostgreSQL fields

>
>> >> 2013/2/1 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>> >> > 2013/2/1 Peter Eisentraut <peter_e(at)gmx(dot)net>:
>> >> >> On 2/1/13 8:00 AM, Pavel Stehule wrote:
>> >> >>> 2013/2/1 Marko Tiikkaja <pgmail(at)joh(dot)to>:
>> >> >>>> Is there a compelling reason why we wouldn't provide these already in
>> >> >>>> 9.3?
>> >> >>>
>> >> >>> a time for assign to last commitfest is out.
>> >> >>>
>> >> >>> this patch is relative simple and really close to enhanced error
>> >> >>> fields feature - but depends if some from commiters will have a time
>> >> >>> for commit to 9.3 - so I am expecting primary target 9.4, but I am not
>> >> >>> be angry if it will be commited early.
>> >> >>
>> >> >> If we don't have access to those fields on PL/pgSQL, what was the point
>> >> >> of the patch to begin with? Surely, accessing them from C wasn't the
>> >> >> main use case?
>> >> >>
>> >> >
>> >> > These fields are available for application developers now. But is a
>> >> > true, so without this patch, GET STACKED DIAGNOSTICS statement will
>> >> > not be fully consistent, because some fields are accessible and others
>> >> > not
>
> I am inclined to back-patch this to 9.3. The patch is fairly mechanical, and
> I think the risk of introducing bugs is less than the risk that folks will be
> confused by these new-in-9.3 error fields being accessible from libpq and the
> protocol, yet inaccessible from PL/pgSQL.
>

+1

>
> The existing protocol documentation says things like this:
>
> Table name: if the error was associated with a specific table, the
> name of the table. (When this field is present, the schema name field
> provides the name of the table's schema.)
>
> The way you have defined RAISE does not enforce this; the user can set
> TABLE_NAME without setting SCHEMA_NAME at all. I see a few options here:
>
> 1. Change RAISE to check the invariants thoroughly. For example, TABLE_NAME
> would require SCHEMA name, and the pair would need to name an actual table.
>
> 2. Change RAISE to check the invariants simply. For example, it could check
> that SCHEMA_NAME is present whenever TABLE_NAME is present but provide no
> validation that the pair names an actual table. (I think the protocol
> language basically allows this, though a brief note wouldn't hurt.)
>
> 3. Tweak the protocol documentation to clearly permit what the patch has RAISE
> allow, namely the free-form use of these fields. This part of the protocol is
> new in 9.3, so it won't be a big deal to change it. The libpq documentation
> has similar verbiage to update.
>
> I suppose I prefer #3. It seems fair for user code to employ these fields for
> applications slightly broader than their core use, like a constraint name that
> represents some userspace notion of a constraint rather than normal, cataloged
> constraint. I can also imagine an application like replaying logs from
> another server, recreating the messages as that server emitted them; #2 or #3
> would suffice for that.
>

I like #3 too. These fields should be used in custom code freely - and
I don't would create some limits. Developer can use it for application
code how he likes. It was designed for this purpose.

> Looking beyond the immediate topic of PL/pgSQL, it seems fair for a FDW to use
> these error fields to name remote objects not known locally. Suppose a
> foreign INSERT fires a remote trigger, and that trigger violates a constraint
> of some other remote table. Naming the remote objects would be a reasonable
> design choice. postgres_fdw might have chosen to just copy fields from the
> remote error (it does not do this today for the fields in question, though).
> The FDW might not even have a notion of a schema, at which point it would
> legitimately choose to leave that field unpopulated. Once we allow any part
> of the system to generate such errors, we should let PL/pgSQL do the same.

+1

Regards

Pavel

>
>
> Thoughts on that plan?
>
> --
> Noah Misch
> EnterpriseDB http://www.enterprisedb.com


From: Noah Misch <noah(at)leadboat(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-28 13:20:26
Message-ID: 20130628132026.GA924898@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jun 28, 2013 at 07:49:46AM +0200, Pavel Stehule wrote:
> 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> > On Tue, Jun 25, 2013 at 03:56:27PM +0200, Pavel Stehule wrote:
> >> cleaned patch is in attachment
> >
> > Of the five options you're adding to GET STACKED DIAGNOSTICS, four of them
> > appear in the SQL standard. DATATYPE_NAME does not; I think we should call it
> > PG_DATATYPE_NAME in line with our other extensions in this area.
> >
>
> yes, but It should be fixed in 9.3 enhanced fields too - it should be
> consistent with PostgreSQL fields

What else, specifically, should be renamed? (Alternately, would you prepare a
new version of the patch incorporating the proper name changes?)

Thanks,
nm

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-28 13:31:00
Message-ID: CAFj8pRAYsv+B2YoUm_2Ur_ddvdaX9=1fEHO3VuDJSqMX3GTTMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> On Fri, Jun 28, 2013 at 07:49:46AM +0200, Pavel Stehule wrote:
>> 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
>> > On Tue, Jun 25, 2013 at 03:56:27PM +0200, Pavel Stehule wrote:
>> >> cleaned patch is in attachment
>> >
>> > Of the five options you're adding to GET STACKED DIAGNOSTICS, four of them
>> > appear in the SQL standard. DATATYPE_NAME does not; I think we should call it
>> > PG_DATATYPE_NAME in line with our other extensions in this area.
>> >
>>
>> yes, but It should be fixed in 9.3 enhanced fields too - it should be
>> consistent with PostgreSQL fields
>
> What else, specifically, should be renamed? (Alternately, would you prepare a
> new version of the patch incorporating the proper name changes?)

I looked to source code, and identifiers in our source code are
consistent, so my comment hasn't sense. Yes, I agree, so only
identifier used in GET DIAGNOSTICS statement should be renamed. So,
only DATATYPE_NAME should be renamed to PG_DATATYPE_NAME.

Regards

Pavel

>
> Thanks,
> nm
>
> --
> Noah Misch
> EnterpriseDB http://www.enterprisedb.com


From: Noah Misch <noah(at)leadboat(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-28 15:11:03
Message-ID: 20130628151103.GB924898@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jun 28, 2013 at 03:31:00PM +0200, Pavel Stehule wrote:
> Hello
>
> 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> > On Fri, Jun 28, 2013 at 07:49:46AM +0200, Pavel Stehule wrote:
> >> 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> >> > On Tue, Jun 25, 2013 at 03:56:27PM +0200, Pavel Stehule wrote:
> >> >> cleaned patch is in attachment
> >> >
> >> > Of the five options you're adding to GET STACKED DIAGNOSTICS, four of them
> >> > appear in the SQL standard. DATATYPE_NAME does not; I think we should call it
> >> > PG_DATATYPE_NAME in line with our other extensions in this area.
> >> >
> >>
> >> yes, but It should be fixed in 9.3 enhanced fields too - it should be
> >> consistent with PostgreSQL fields
> >
> > What else, specifically, should be renamed? (Alternately, would you prepare a
> > new version of the patch incorporating the proper name changes?)
>
> I looked to source code, and identifiers in our source code are
> consistent, so my comment hasn't sense. Yes, I agree, so only
> identifier used in GET DIAGNOSTICS statement should be renamed. So,
> only DATATYPE_NAME should be renamed to PG_DATATYPE_NAME.

Okay. I failed to note the first time through that while the patch uses the
same option names for RAISE and GET STACKED DIAGNOSTICS, the existing option
lists for those commands differ:

--RAISE option-- --GET STACKED DIAGNOSTICS option--
ERRCODE RETURNED_SQLSTATE
MESSAGE MESSAGE_TEXT
DETAIL PG_EXCEPTION_DETAIL
HINT PG_EXCEPTION_HINT
CONTEXT PG_EXCEPTION_CONTEXT

To be consistent with that pattern, I think we would use COLUMN, CONSTRAINT,
TABLE, TYPE and SCHEMA as the new RAISE options.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-28 15:21:29
Message-ID: CAFj8pRBYM-UOrCNSqq55-hH64C-fi_EabwB909w5FvERaf2cnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> On Fri, Jun 28, 2013 at 03:31:00PM +0200, Pavel Stehule wrote:
>> Hello
>>
>> 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
>> > On Fri, Jun 28, 2013 at 07:49:46AM +0200, Pavel Stehule wrote:
>> >> 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
>> >> > On Tue, Jun 25, 2013 at 03:56:27PM +0200, Pavel Stehule wrote:
>> >> >> cleaned patch is in attachment
>> >> >
>> >> > Of the five options you're adding to GET STACKED DIAGNOSTICS, four of them
>> >> > appear in the SQL standard. DATATYPE_NAME does not; I think we should call it
>> >> > PG_DATATYPE_NAME in line with our other extensions in this area.
>> >> >
>> >>
>> >> yes, but It should be fixed in 9.3 enhanced fields too - it should be
>> >> consistent with PostgreSQL fields
>> >
>> > What else, specifically, should be renamed? (Alternately, would you prepare a
>> > new version of the patch incorporating the proper name changes?)
>>
>> I looked to source code, and identifiers in our source code are
>> consistent, so my comment hasn't sense. Yes, I agree, so only
>> identifier used in GET DIAGNOSTICS statement should be renamed. So,
>> only DATATYPE_NAME should be renamed to PG_DATATYPE_NAME.
>
> Okay. I failed to note the first time through that while the patch uses the
> same option names for RAISE and GET STACKED DIAGNOSTICS, the existing option
> lists for those commands differ:
>
> --RAISE option-- --GET STACKED DIAGNOSTICS option--
> ERRCODE RETURNED_SQLSTATE
> MESSAGE MESSAGE_TEXT
> DETAIL PG_EXCEPTION_DETAIL
> HINT PG_EXCEPTION_HINT
> CONTEXT PG_EXCEPTION_CONTEXT
>
> To be consistent with that pattern, I think we would use COLUMN, CONSTRAINT,
> TABLE, TYPE and SCHEMA as the new RAISE options.

I understand to your motivation, but I am not sure. Minimally word
"TYPE" is too general. I have not strong opinion in this area. maybe
DATATYPE ??

p.s. you cannot to specify CONTEXT in RAISE statement

Regards

Pavel

>
> --
> Noah Misch
> EnterpriseDB http://www.enterprisedb.com


From: Noah Misch <noah(at)leadboat(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-06-28 16:08:21
Message-ID: 20130628160821.GC924898@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jun 28, 2013 at 05:21:29PM +0200, Pavel Stehule wrote:
> 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> > Okay. I failed to note the first time through that while the patch uses the
> > same option names for RAISE and GET STACKED DIAGNOSTICS, the existing option
> > lists for those commands differ:
> >
> > --RAISE option-- --GET STACKED DIAGNOSTICS option--
> > ERRCODE RETURNED_SQLSTATE
> > MESSAGE MESSAGE_TEXT
> > DETAIL PG_EXCEPTION_DETAIL
> > HINT PG_EXCEPTION_HINT
> > CONTEXT PG_EXCEPTION_CONTEXT
> >
> > To be consistent with that pattern, I think we would use COLUMN, CONSTRAINT,
> > TABLE, TYPE and SCHEMA as the new RAISE options.
>
> I understand to your motivation, but I am not sure. Minimally word
> "TYPE" is too general. I have not strong opinion in this area. maybe
> DATATYPE ??

I'm not positive either. DATATYPE rather than TYPE makes sense.

> p.s. you cannot to specify CONTEXT in RAISE statement

Oops; right.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com


From: Noah Misch <noah(at)leadboat(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-07-02 20:22:00
Message-ID: 20130702202200.GA996935@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jun 28, 2013 at 12:08:21PM -0400, Noah Misch wrote:
> On Fri, Jun 28, 2013 at 05:21:29PM +0200, Pavel Stehule wrote:
> > 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
> > > Okay. I failed to note the first time through that while the patch uses the
> > > same option names for RAISE and GET STACKED DIAGNOSTICS, the existing option
> > > lists for those commands differ:
> > >
> > > --RAISE option-- --GET STACKED DIAGNOSTICS option--
> > > ERRCODE RETURNED_SQLSTATE
> > > MESSAGE MESSAGE_TEXT
> > > DETAIL PG_EXCEPTION_DETAIL
> > > HINT PG_EXCEPTION_HINT
> > > CONTEXT PG_EXCEPTION_CONTEXT
> > >
> > > To be consistent with that pattern, I think we would use COLUMN, CONSTRAINT,
> > > TABLE, TYPE and SCHEMA as the new RAISE options.
> >
> > I understand to your motivation, but I am not sure. Minimally word
> > "TYPE" is too general. I have not strong opinion in this area. maybe
> > DATATYPE ??
>
> I'm not positive either. DATATYPE rather than TYPE makes sense.

Here's a revision bearing the discussed name changes and protocol
documentation tweaks, along with some cosmetic adjustments. If this seems
good to you, I will commit it.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
enhanced_error_fields_plpgsql-v3.patch text/plain 28.8 KB

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-07-03 04:17:18
Message-ID: CAFj8pRCd9YxBfTRYvtOpYV+kSSoXAeUXHpAhxsteJkWFxZU-5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

2013/7/2 Noah Misch <noah(at)leadboat(dot)com>:
> On Fri, Jun 28, 2013 at 12:08:21PM -0400, Noah Misch wrote:
>> On Fri, Jun 28, 2013 at 05:21:29PM +0200, Pavel Stehule wrote:
>> > 2013/6/28 Noah Misch <noah(at)leadboat(dot)com>:
>> > > Okay. I failed to note the first time through that while the patch uses the
>> > > same option names for RAISE and GET STACKED DIAGNOSTICS, the existing option
>> > > lists for those commands differ:
>> > >
>> > > --RAISE option-- --GET STACKED DIAGNOSTICS option--
>> > > ERRCODE RETURNED_SQLSTATE
>> > > MESSAGE MESSAGE_TEXT
>> > > DETAIL PG_EXCEPTION_DETAIL
>> > > HINT PG_EXCEPTION_HINT
>> > > CONTEXT PG_EXCEPTION_CONTEXT
>> > >
>> > > To be consistent with that pattern, I think we would use COLUMN, CONSTRAINT,
>> > > TABLE, TYPE and SCHEMA as the new RAISE options.
>> >
>> > I understand to your motivation, but I am not sure. Minimally word
>> > "TYPE" is too general. I have not strong opinion in this area. maybe
>> > DATATYPE ??
>>
>> I'm not positive either. DATATYPE rather than TYPE makes sense.
>
> Here's a revision bearing the discussed name changes and protocol
> documentation tweaks, along with some cosmetic adjustments. If this seems
> good to you, I will commit it.
>

+1

Pavel

> --
> Noah Misch
> EnterpriseDB http://www.enterprisedb.com


From: Noah Misch <noah(at)leadboat(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-07-03 11:46:33
Message-ID: 20130703114633.GB1007976@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jul 03, 2013 at 06:17:18AM +0200, Pavel Stehule wrote:
> 2013/7/2 Noah Misch <noah(at)leadboat(dot)com>:
> > Here's a revision bearing the discussed name changes and protocol
> > documentation tweaks, along with some cosmetic adjustments. If this seems
> > good to you, I will commit it.
>
> +1

Done.

Rushabh, I neglected to credit you as a reviewer and realized it too late.
Sorry about that.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-07-03 11:51:02
Message-ID: CAFj8pRACUTTRMNsy_UQbcLyN9u9YYcUH9jub8Q_MbH4AeA57ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/7/3 Noah Misch <noah(at)leadboat(dot)com>:
> On Wed, Jul 03, 2013 at 06:17:18AM +0200, Pavel Stehule wrote:
>> 2013/7/2 Noah Misch <noah(at)leadboat(dot)com>:
>> > Here's a revision bearing the discussed name changes and protocol
>> > documentation tweaks, along with some cosmetic adjustments. If this seems
>> > good to you, I will commit it.
>>
>> +1
>
> Done.

Thank you, very much

Regards

Pavel

>
> Rushabh, I neglected to credit you as a reviewer and realized it too late.
> Sorry about that.
>
> --
> Noah Misch
> EnterpriseDB http://www.enterprisedb.com


From: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Marko Tiikkaja <pgmail(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: enable new error fields in plpgsql (9.4)
Date: 2013-07-15 11:55:14
Message-ID: CAGPqQf0TF-+8KP-MMAeLE5cL_S=yMD9NAn61wRa0vQtRZpFpDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jul 3, 2013 at 5:16 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:

> On Wed, Jul 03, 2013 at 06:17:18AM +0200, Pavel Stehule wrote:
> > 2013/7/2 Noah Misch <noah(at)leadboat(dot)com>:
> > > Here's a revision bearing the discussed name changes and protocol
> > > documentation tweaks, along with some cosmetic adjustments. If this
> seems
> > > good to you, I will commit it.
> >
> > +1
>
> Done.
>
> Rushabh, I neglected to credit you as a reviewer and realized it too late.
> Sorry about that.
>

Sorry somehow I missed this thread.

Thanks Noah.

>
> --
> Noah Misch
> EnterpriseDB http://www.enterprisedb.com
>

--
Rushabh Lathia