Re: Re: proposal: ignore null fields in not relation type composite type based constructors

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: Re: proposal: ignore null fields in not relation type composite type based constructors
Date: 2014-09-03 07:55:16
Message-ID: CAFj8pRCzfTGXa9CZizVEaDWKpnYoUgEzTC9NhhALUMo6Mx_B3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2014-09-03 9:27 GMT+02:00 Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>:

> Hi Pavel,
>
> Here are few more comments on new implementation.
>
> 1.
> /*
> - * SQL function row_to_json(row)
> + * SQL function row_to_json(row record, pretty bool, ignore_nulls bool)
> */
>
> In above comments, parameter name "row" should changed to "rowval".
>
> 2.
> -DATA(insert OID = 3155 ( row_to_json PGNSP PGUID 12 1 0 0 0 f f f
> f t f s 1 0 114 "2249" _null_ _null_ _null_ _null_ row_to_json _null_
> _null_ _null_ ));
> +DATA(insert OID = 3155 ( row_to_json PGNSP PGUID 12 1 0 0 0 f f f
> f t f s 1 0 114 "2249 16 16" _null_ _null_ "{rowval,pretty,ignore_nulls}"
> _null_ row_to_json _null_ _null_ _null_ ));
>
> Number of arguments (pronargs) should be 3 now. However, when we create it
> again with default values it gets updated. But still here we should not
> have
> inconsistency.
>
> 3.
> extern Datum row_to_json(PG_FUNCTION_ARGS);
> extern Datum row_to_json_pretty(PG_FUNCTION_ARGS);
> +extern Datum row_to_json_pretty_choosy(PG_FUNCTION_ARGS);
> extern Datum to_json(PG_FUNCTION_ARGS);
>
> With this new implementation, we have NOT added row_to_json_pretty_choosy()
> function. So need to remove that added line. Also we have only one function
> with default arguments and thus removed row_to_json_pretty() function as
> well. Thus need to remove extern for that too.
>
> 4.
> Can we have couple of test cases with named argument along with skipped
> pretty parameter test?
>
>
>
done

Regards

Pavel

>
> Thanks
>
> --
> Jeevan B Chalke
> Principal Software Engineer, Product Development
> EnterpriseDB Corporation
> The Enterprise PostgreSQL Company
>
>

Attachment Content-Type Size
help-variables-11.patch text/x-patch 20.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-09-03 08:07:16 Re: PL/pgSQL 2
Previous Message Pavel Stehule 2014-09-03 07:35:28 Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]