Re: json (b) and null fields

Lists: pgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: json (b) and null fields
Date: 2014-09-26 14:59:08
Message-ID: 54257F3C.10303@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I should have been paying a bit more attention to the recent work on
adding an ignore_nulls option to row_to_json(). Here are some belated
thought. I apologize to Pavel and Stephen for not having commented earlier.

I think this is really a bandaid, and it will fail to catch lots of
cases. Several examples:

* it doesn't apply recursively, so if the row has a nested composite,
or an array of composites, none of those will have nulls ignored,
only the top level will.
* it doesn't apply to other json generators, notably json_agg().
That's a very big omission.
* it does nothing to allow us to strip nulls from existing json/jsonb
data.

I think a much more comprehensive solution would be preferable. What I
have in mind is something like

json_strip_null_fields(json) -> json

and a similar function for jsonb.

These would operate recursively. There is a downside, in that they would
be required to reprocess the json/jsonb. But adding an option like this
to all the json generator functions would be seriously ugly, especially
since they are mostly aggregate functions or variadic functions. At
least in the jsonb case the cost of reprocessing is likely to be fairly low.

cheers

andrew


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-27 12:00:09
Message-ID: 20140927120009.GG16422@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew, all,

* Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
> I should have been paying a bit more attention to the recent work on
> adding an ignore_nulls option to row_to_json(). Here are some
> belated thought. I apologize to Pavel and Stephen for not having
> commented earlier.

No problem at all and thanks for continuing to think about it! We
certainly still have quite a bit of time til 9.5 to get this right.

> I think this is really a bandaid, and it will fail to catch lots of
> cases. Several examples:

As discussed on IRC- I agree. I tend to think of JSON objects as
relatively simple hstore-like structures and so hadn't considered the
complex structure case (as I'm guessing Pavel hadn't either).

> I think a much more comprehensive solution would be preferable. What
> I have in mind is something like
>
> json_strip_null_fields(json) -> json
>
> and a similar function for jsonb.

Right, this makes sense to me.

> These would operate recursively. There is a downside, in that they
> would be required to reprocess the json/jsonb. But adding an option
> like this to all the json generator functions would be seriously
> ugly, especially since they are mostly aggregate functions or
> variadic functions. At least in the jsonb case the cost of
> reprocessing is likely to be fairly low.

Yeah, I don't see adding this option to all json generator functions as
making a lot of sense but rather just to the select few things which it
really makes sense for and then having a function which can be used by
users to do the same for results from other operations.

Thanks!

Stephen


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-27 17:57:27
Message-ID: 5426FA87.2040407@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/27/2014 08:00 AM, Stephen Frost wrote:
> Andrew, all,
>
> * Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
>> I should have been paying a bit more attention to the recent work on
>> adding an ignore_nulls option to row_to_json(). Here are some
>> belated thought. I apologize to Pavel and Stephen for not having
>> commented earlier.
> No problem at all and thanks for continuing to think about it! We
> certainly still have quite a bit of time til 9.5 to get this right.
>
>> I think this is really a bandaid, and it will fail to catch lots of
>> cases. Several examples:
> As discussed on IRC- I agree. I tend to think of JSON objects as
> relatively simple hstore-like structures and so hadn't considered the
> complex structure case (as I'm guessing Pavel hadn't either).
>
>> I think a much more comprehensive solution would be preferable. What
>> I have in mind is something like
>>
>> json_strip_null_fields(json) -> json
>>
>> and a similar function for jsonb.
> Right, this makes sense to me.
>
>> These would operate recursively. There is a downside, in that they
>> would be required to reprocess the json/jsonb. But adding an option
>> like this to all the json generator functions would be seriously
>> ugly, especially since they are mostly aggregate functions or
>> variadic functions. At least in the jsonb case the cost of
>> reprocessing is likely to be fairly low.
> Yeah, I don't see adding this option to all json generator functions as
> making a lot of sense but rather just to the select few things which it
> really makes sense for and then having a function which can be used by
> users to do the same for results from other operations.
>
>

I guess I'm questioning the wisdom of keeping it for row_to_json given
that it doesn't operate recursively anyway (and making it do so would be
difficult and ugly).

The counter argument for this is that nested composites and arrays of
composites are relatively rare in records, so providing a fast
non-recursive stripping of nulls for the common case is reasonable.

If we're going to keep this, I think we also need to provide it
(non-recursive) for json_agg via an optional second argument. This
should be a fairly simple change: just steer the result via
composite_to_json if it's a record, rather than to datum_to_json.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-27 22:27:33
Message-ID: 9554.1411856853@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 09/27/2014 08:00 AM, Stephen Frost wrote:
>> Yeah, I don't see adding this option to all json generator functions as
>> making a lot of sense but rather just to the select few things which it
>> really makes sense for and then having a function which can be used by
>> users to do the same for results from other operations.

> I guess I'm questioning the wisdom of keeping it for row_to_json given
> that it doesn't operate recursively anyway (and making it do so would be
> difficult and ugly).

IMO, adding it to row_to_json was really ugly to start with, independently
of whether it's difficult or not. That function had one too many optional
arguments already, and in its current form it's nothing but a loaded gun
pointed at users' feet. (Quick, which bool argument is which?)

> If we're going to keep this, I think we also need to provide it
> (non-recursive) for json_agg via an optional second argument. This
> should be a fairly simple change: just steer the result via
> composite_to_json if it's a record, rather than to datum_to_json.

Unfortunately, any such thing will fall foul of an established project
policy. I quote the opr_sanity regression test that will complain:

-- Check that there are not aggregates with the same name and different
-- numbers of arguments. While not technically wrong, we have a project policy
-- to avoid this because it opens the door for confusion in connection with
-- ORDER BY: novices frequently put the ORDER BY in the wrong place.
-- See the fate of the single-argument form of string_agg() for history.

So my vote is for a separate function and no optional arguments.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-27 23:58:43
Message-ID: 54274F33.4090109@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/27/2014 06:27 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> On 09/27/2014 08:00 AM, Stephen Frost wrote:
>>> Yeah, I don't see adding this option to all json generator functions as
>>> making a lot of sense but rather just to the select few things which it
>>> really makes sense for and then having a function which can be used by
>>> users to do the same for results from other operations.
>> I guess I'm questioning the wisdom of keeping it for row_to_json given
>> that it doesn't operate recursively anyway (and making it do so would be
>> difficult and ugly).
> IMO, adding it to row_to_json was really ugly to start with, independently
> of whether it's difficult or not. That function had one too many optional
> arguments already, and in its current form it's nothing but a loaded gun
> pointed at users' feet. (Quick, which bool argument is which?)
>
>> If we're going to keep this, I think we also need to provide it
>> (non-recursive) for json_agg via an optional second argument. This
>> should be a fairly simple change: just steer the result via
>> composite_to_json if it's a record, rather than to datum_to_json.
> Unfortunately, any such thing will fall foul of an established project
> policy. I quote the opr_sanity regression test that will complain:
>
> -- Check that there are not aggregates with the same name and different
> -- numbers of arguments. While not technically wrong, we have a project policy
> -- to avoid this because it opens the door for confusion in connection with
> -- ORDER BY: novices frequently put the ORDER BY in the wrong place.
> -- See the fate of the single-argument form of string_agg() for history.
>
> So my vote is for a separate function and no optional arguments.
>
>

You mean like row_to_json_no_nulls() and json_agg_no_nulls()?

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-28 02:52:59
Message-ID: 15091.1411872779@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 09/27/2014 06:27 PM, Tom Lane wrote:
>> So my vote is for a separate function and no optional arguments.

> You mean like row_to_json_no_nulls() and json_agg_no_nulls()?

I thought you were proposing that we should revert the committed patch
lock-stock-n-barrel, and instead invent json_strip_null_fields().
That's instead, not in addition to. Even if you weren't saying that
exactly, that's where my vote goes.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-28 03:00:49
Message-ID: 542779E1.2070702@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/27/2014 10:52 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> On 09/27/2014 06:27 PM, Tom Lane wrote:
>>> So my vote is for a separate function and no optional arguments.
>> You mean like row_to_json_no_nulls() and json_agg_no_nulls()?
> I thought you were proposing that we should revert the committed patch
> lock-stock-n-barrel, and instead invent json_strip_null_fields().
> That's instead, not in addition to. Even if you weren't saying that
> exactly, that's where my vote goes.

I was just exploring alternatives. But I think that's where my vote goes
too.

cheers

andrew


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-28 03:58:27
Message-ID: CAOuzzgpvx5EDt+KBUKjs7_mUH78nudDNRxbJYUYGSHMAv9MK=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

All,

On Saturday, September 27, 2014, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

>
> On 09/27/2014 10:52 PM, Tom Lane wrote:
>
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>
>>> On 09/27/2014 06:27 PM, Tom Lane wrote:
>>>
>>>> So my vote is for a separate function and no optional arguments.
>>>>
>>> You mean like row_to_json_no_nulls() and json_agg_no_nulls()?
>>>
>> I thought you were proposing that we should revert the committed patch
>> lock-stock-n-barrel, and instead invent json_strip_null_fields().
>> That's instead, not in addition to. Even if you weren't saying that
>> exactly, that's where my vote goes.
>>
>
>
> I was just exploring alternatives. But I think that's where my vote goes
> too.
>

I'm fine with that. I'd like the strip-Nulls capability, but seems like
it'd be better off as an independent function (or functions) instead.

Thanks,

Stephen


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-28 16:35:23
Message-ID: 542838CB.6000400@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/27/2014 11:58 PM, Stephen Frost wrote:
> All,
>
> On Saturday, September 27, 2014, Andrew Dunstan <andrew(at)dunslane(dot)net
> <mailto:andrew(at)dunslane(dot)net>> wrote:
>
>
> On 09/27/2014 10:52 PM, Tom Lane wrote:
>
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
> On 09/27/2014 06:27 PM, Tom Lane wrote:
>
> So my vote is for a separate function and no optional
> arguments.
>
> You mean like row_to_json_no_nulls() and json_agg_no_nulls()?
>
> I thought you were proposing that we should revert the
> committed patch
> lock-stock-n-barrel, and instead invent json_strip_null_fields().
> That's instead, not in addition to. Even if you weren't
> saying that
> exactly, that's where my vote goes.
>
>
>
> I was just exploring alternatives. But I think that's where my
> vote goes too.
>
>
> I'm fine with that. I'd like the strip-Nulls capability, but seems
> like it'd be better off as an independent function (or functions)
> instead.
>
>

Unlike the row_to_json stuff, json{b}_strip_null_fields() can almost
certainly be done as a small extension. One advantage of that is that it
would be used with 9.4.

cheers

andrew


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 14:38:59
Message-ID: CA+TgmoaLhetdFz9v9ONZTQF48srOwKVjEexg8+FH=Yw1wLYQ4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Sep 27, 2014 at 11:00 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> On 09/27/2014 10:52 PM, Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> On 09/27/2014 06:27 PM, Tom Lane wrote:
>>>>
>>>> So my vote is for a separate function and no optional arguments.
>>>
>>> You mean like row_to_json_no_nulls() and json_agg_no_nulls()?
>>
>> I thought you were proposing that we should revert the committed patch
>> lock-stock-n-barrel, and instead invent json_strip_null_fields().
>> That's instead, not in addition to. Even if you weren't saying that
>> exactly, that's where my vote goes.
>
> I was just exploring alternatives. But I think that's where my vote goes
> too.

+1. I am sort of surprised that anyone things this null-stripping
behavior is something that ought to be part of core PostgreSQL instead
of, I don't know, relegated to an extension somewhere far from the
bright center of the galaxy. I've never heard of that requirement
anywhere but here. But if other people feel we should have it, that's
fine - but certainly making it a separate function makes a lot more
sense.

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


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 14:45:24
Message-ID: 20140929144524.GS16422@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

* Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
> +1. I am sort of surprised that anyone things this null-stripping
> behavior is something that ought to be part of core PostgreSQL instead
> of, I don't know, relegated to an extension somewhere far from the
> bright center of the galaxy. I've never heard of that requirement
> anywhere but here. But if other people feel we should have it, that's
> fine - but certainly making it a separate function makes a lot more
> sense.

I'm not at all surprised by the request, and I do believe it to be
worthwhile to have in core as it's a pretty common pattern with JSON.
That said, making it part of an operator function wasn't the right
approach and it should be an independent function.

Once I've caught up on things this morning, I'll revert the original
commit and ping Pavel about an alternative implementation, with an
independent function, which also handles complex JSON (unless anyone
else wants to volunteer to work on it..).

Thanks,

Stephen


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 15:19:39
Message-ID: 5429788B.7020608@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/29/2014 10:38 AM, Robert Haas wrote:
> On Sat, Sep 27, 2014 at 11:00 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> On 09/27/2014 10:52 PM, Tom Lane wrote:
>>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>>> On 09/27/2014 06:27 PM, Tom Lane wrote:
>>>>> So my vote is for a separate function and no optional arguments.
>>>> You mean like row_to_json_no_nulls() and json_agg_no_nulls()?
>>> I thought you were proposing that we should revert the committed patch
>>> lock-stock-n-barrel, and instead invent json_strip_null_fields().
>>> That's instead, not in addition to. Even if you weren't saying that
>>> exactly, that's where my vote goes.
>> I was just exploring alternatives. But I think that's where my vote goes
>> too.
> +1. I am sort of surprised that anyone things this null-stripping
> behavior is something that ought to be part of core PostgreSQL instead
> of, I don't know, relegated to an extension somewhere far from the
> bright center of the galaxy. I've never heard of that requirement
> anywhere but here. But if other people feel we should have it, that's
> fine - but certainly making it a separate function makes a lot more
> sense.
>

Fetching data from a missing field should return null, so stripping null
fields can give you in effect the same result, depending on what your
app does, without actually having to store the key and the null. And if
we're producing JSON for an external processor from a table that is
fairly sparsely populated, this could reduce the size of the JSON
enormously.

That said, doing this as an extension is probably a good way to go, as I
suggested upthread, since we could then make it available for 9.4,
rather than making people wait until 9.5.

cheers

andrew


From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 15:28:20
Message-ID: CAHyXU0zqMHtN12CYn9rbgdPkpd3BXe+iEQw4Fzqa_nW2r6Bong@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Sep 29, 2014 at 9:45 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> * Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
>> +1. I am sort of surprised that anyone things this null-stripping
>> behavior is something that ought to be part of core PostgreSQL instead
>> of, I don't know, relegated to an extension somewhere far from the
>> bright center of the galaxy. I've never heard of that requirement
>> anywhere but here. But if other people feel we should have it, that's
>> fine - but certainly making it a separate function makes a lot more
>> sense.
>
> I'm not at all surprised by the request, and I do believe it to be
> worthwhile to have in core as it's a pretty common pattern with JSON.
> That said, making it part of an operator function wasn't the right
> approach and it should be an independent function.

Are you defining 'core' as 'supported by the core project' (in which
case I agree) or 'not an extension' (in which case I disagree).

merlin


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 15:38:52
Message-ID: 20140929153852.GU16422@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

* Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
> That said, doing this as an extension is probably a good way to go,
> as I suggested upthread, since we could then make it available for
> 9.4, rather than making people wait until 9.5.

Two points on this- having it in 9.5 doesn't preclude someone from
extracting it into an extension for 9.4 (indeed, that makes it far more
likely for such an extension to actually happen, imv..), and having it
in core means it's actually generally available and a function which can
be depended upon, which is far from the case for an extension. Things
are a bit better if it's in contrib, though we'd want to have more than
one function provided in such a contrib extension.

Perhaps there are other functions related to JSON which should go into
such a contrib extension which would make it more worthwhile.. Would
hate to have an extension that ends up being "yeah, to actually use
JSON in PG you have to have this extension" either though.

I realize that can possibly be a "slippery slope", where we end up with
more in core than really belongs there, but this strikes me as a common
enough case that we should cover it. If I didn't feel it would be a
frequently used capability, I wouldn't have supported adding it in the
first place..

Thanks,

Stephen


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 15:40:36
Message-ID: 20140929154036.GV16422@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Merlin,

* Merlin Moncure (mmoncure(at)gmail(dot)com) wrote:
> Are you defining 'core' as 'supported by the core project' (in which
> case I agree) or 'not an extension' (in which case I disagree).

Which means you're suggesting it as an extension which lives in
contrib..? Otherwise, I'm not following.

If that is the suggestion, then I'd want to have something more than
just this one function for that contrib extension... Suggestions?

Thanks,

Stephen


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 16:09:31
Message-ID: 26185.1412006971@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
>> That said, doing this as an extension is probably a good way to go,
>> as I suggested upthread, since we could then make it available for
>> 9.4, rather than making people wait until 9.5.

> Two points on this- having it in 9.5 doesn't preclude someone from
> extracting it into an extension for 9.4 (indeed, that makes it far more
> likely for such an extension to actually happen, imv..), and having it
> in core means it's actually generally available and a function which can
> be depended upon, which is far from the case for an extension.

I seem to recall that we've run into practical difficulties with moving
extensions into core. It might be OK for a functions-only extension
though.

regards, tom lane


From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 16:17:15
Message-ID: 69E07D57-E5BA-4FB1-A9F6-B21FBB3A1558@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sep 29, 2014, at 9:09 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I seem to recall that we've run into practical difficulties with moving
> extensions into core. It might be OK for a functions-only extension
> though.

It does make upgrading difficult, though, as I’ve learned the hard way with when upgrading from 9.2 with json_enhancements to 9.3 without. We had to do some selective dropping and re-creating of functions, views, and triggers to get it all to work properly.

Best,

David


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 19:13:50
Message-ID: CAFj8pRB6W5UkoX8wxOcxyf0TrLj4jtvSq2cN5CmFS9kgAukEqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-09-28 18:35 GMT+02:00 Andrew Dunstan <andrew(at)dunslane(dot)net>:

>
> On 09/27/2014 11:58 PM, Stephen Frost wrote:
>
>> All,
>>
>>
>> On Saturday, September 27, 2014, Andrew Dunstan <andrew(at)dunslane(dot)net
>> <mailto:andrew(at)dunslane(dot)net>> wrote:
>>
>>
>> On 09/27/2014 10:52 PM, Tom Lane wrote:
>>
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>
>> On 09/27/2014 06:27 PM, Tom Lane wrote:
>>
>> So my vote is for a separate function and no optional
>> arguments.
>>
>> You mean like row_to_json_no_nulls() and json_agg_no_nulls()?
>>
>> I thought you were proposing that we should revert the
>> committed patch
>> lock-stock-n-barrel, and instead invent json_strip_null_fields().
>> That's instead, not in addition to. Even if you weren't
>> saying that
>> exactly, that's where my vote goes.
>>
>>
>>
>> I was just exploring alternatives. But I think that's where my
>> vote goes too.
>>
>>
>> I'm fine with that. I'd like the strip-Nulls capability, but seems like
>> it'd be better off as an independent function (or functions) instead.
>>
>>
>>
> Unlike the row_to_json stuff, json{b}_strip_null_fields() can almost
> certainly be done as a small extension. One advantage of that is that it
> would be used with 9.4.

In other mail you wrote, how much important is this functionality for JSON,
so I don't think so a movement to contrib is a good idea.

We can implement all described functionality in separate function, but it
should be in core probably. It is not my idea. I was asked about this
functionality by some PostgreSQL 9.4 early users and testers on Czech
mailing list.

Regards

Pavel

>
>
> cheers
>
> andrew
>
>
>
> --
> 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
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 19:17:44
Message-ID: CAFj8pRCmqe=YsWFC1AySwi6o6=EKS0JcU0yHCmaJ=i0hP_sDoA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-09-29 17:38 GMT+02:00 Stephen Frost <sfrost(at)snowman(dot)net>:

> * Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
> > That said, doing this as an extension is probably a good way to go,
> > as I suggested upthread, since we could then make it available for
> > 9.4, rather than making people wait until 9.5.
>
> Two points on this- having it in 9.5 doesn't preclude someone from
> extracting it into an extension for 9.4 (indeed, that makes it far more
> likely for such an extension to actually happen, imv..), and having it
> in core means it's actually generally available and a function which can
> be depended upon, which is far from the case for an extension. Things
> are a bit better if it's in contrib, though we'd want to have more than
> one function provided in such a contrib extension.
>

+1

Pavel

>
> Perhaps there are other functions related to JSON which should go into
> such a contrib extension which would make it more worthwhile.. Would
> hate to have an extension that ends up being "yeah, to actually use
> JSON in PG you have to have this extension" either though.
>
> I realize that can possibly be a "slippery slope", where we end up with
> more in core than really belongs there, but this strikes me as a common
> enough case that we should cover it. If I didn't feel it would be a
> frequently used capability, I wouldn't have supported adding it in the
> first place..
>
> Thanks,
>
> Stephen
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 19:23:31
Message-ID: CAFj8pRD29_FX3eTzHHBRcn_9uFa=ycyXRDQNKRZjF1tiJYD8AA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-09-27 14:00 GMT+02:00 Stephen Frost <sfrost(at)snowman(dot)net>:

> Andrew, all,
>
> * Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
> > I should have been paying a bit more attention to the recent work on
> > adding an ignore_nulls option to row_to_json(). Here are some
> > belated thought. I apologize to Pavel and Stephen for not having
> > commented earlier.
>
> No problem at all and thanks for continuing to think about it! We
> certainly still have quite a bit of time til 9.5 to get this right.
>
> > I think this is really a bandaid, and it will fail to catch lots of
> > cases. Several examples:
>
> As discussed on IRC- I agree. I tend to think of JSON objects as
> relatively simple hstore-like structures and so hadn't considered the
> complex structure case (as I'm guessing Pavel hadn't either).
>
> > I think a much more comprehensive solution would be preferable. What
> > I have in mind is something like
> >
> > json_strip_null_fields(json) -> json
> >
> > and a similar function for jsonb.
>
> Right, this makes sense to me.
>

It is better than nothing, but it is not nice for JSON due 2x parsing.
Probably it is not issue for jsonb.

It is not nice, but I have not better .. and it will be faster than any
custom solution in plpgsql.

Personally, I am not sure, maybe is better to fix row_to_json

Regards

Pavel

>
> > These would operate recursively. There is a downside, in that they
> > would be required to reprocess the json/jsonb. But adding an option
> > like this to all the json generator functions would be seriously
> > ugly, especially since they are mostly aggregate functions or
> > variadic functions. At least in the jsonb case the cost of
> > reprocessing is likely to be fairly low.
>
> Yeah, I don't see adding this option to all json generator functions as
> making a lot of sense but rather just to the select few things which it
> really makes sense for and then having a function which can be used by
> users to do the same for results from other operations.
>
> Thanks!
>
> Stephen
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 19:28:06
Message-ID: CAFj8pRDx0jnpeQSkbU+6-haioVoLSAiJrr69uFPdVitHB=aDHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-09-29 21:23 GMT+02:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

>
>
> 2014-09-27 14:00 GMT+02:00 Stephen Frost <sfrost(at)snowman(dot)net>:
>
>> Andrew, all,
>>
>> * Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
>> > I should have been paying a bit more attention to the recent work on
>> > adding an ignore_nulls option to row_to_json(). Here are some
>> > belated thought. I apologize to Pavel and Stephen for not having
>> > commented earlier.
>>
>> No problem at all and thanks for continuing to think about it! We
>> certainly still have quite a bit of time til 9.5 to get this right.
>>
>> > I think this is really a bandaid, and it will fail to catch lots of
>> > cases. Several examples:
>>
>> As discussed on IRC- I agree. I tend to think of JSON objects as
>> relatively simple hstore-like structures and so hadn't considered the
>> complex structure case (as I'm guessing Pavel hadn't either).
>>
>> > I think a much more comprehensive solution would be preferable. What
>> > I have in mind is something like
>> >
>> > json_strip_null_fields(json) -> json
>> >
>> > and a similar function for jsonb.
>>
>> Right, this makes sense to me.
>>
>
> It is better than nothing, but it is not nice for JSON due 2x parsing.
> Probably it is not issue for jsonb.
>
> It is not nice, but I have not better .. and it will be faster than any
> custom solution in plpgsql.
>
> Personally, I am not sure, maybe is better to fix row_to_json
>

we can use a different name like row_to_json_strip_null

>
> Regards
>
> Pavel
>
>
>>
>> > These would operate recursively. There is a downside, in that they
>> > would be required to reprocess the json/jsonb. But adding an option
>> > like this to all the json generator functions would be seriously
>> > ugly, especially since they are mostly aggregate functions or
>> > variadic functions. At least in the jsonb case the cost of
>> > reprocessing is likely to be fairly low.
>>
>> Yeah, I don't see adding this option to all json generator functions as
>> making a lot of sense but rather just to the select few things which it
>> really makes sense for and then having a function which can be used by
>> users to do the same for results from other operations.
>>
>> Thanks!
>>
>> Stephen
>>
>
>


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 20:03:13
Message-ID: 5429BB01.8060605@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/29/2014 03:23 PM, Pavel Stehule wrote:
>
>
> 2014-09-27 14:00 GMT+02:00 Stephen Frost <sfrost(at)snowman(dot)net
> <mailto:sfrost(at)snowman(dot)net>>:
>
> Andrew, all,
>
> * Andrew Dunstan (andrew(at)dunslane(dot)net
> <mailto:andrew(at)dunslane(dot)net>) wrote:
> > I should have been paying a bit more attention to the recent work on
> > adding an ignore_nulls option to row_to_json(). Here are some
> > belated thought. I apologize to Pavel and Stephen for not having
> > commented earlier.
>
> No problem at all and thanks for continuing to think about it! We
> certainly still have quite a bit of time til 9.5 to get this right.
>
> > I think this is really a bandaid, and it will fail to catch lots of
> > cases. Several examples:
>
> As discussed on IRC- I agree. I tend to think of JSON objects as
> relatively simple hstore-like structures and so hadn't considered the
> complex structure case (as I'm guessing Pavel hadn't either).
>
> > I think a much more comprehensive solution would be preferable. What
> > I have in mind is something like
> >
> > json_strip_null_fields(json) -> json
> >
> > and a similar function for jsonb.
>
> Right, this makes sense to me.
>
>
> It is better than nothing, but it is not nice for JSON due 2x parsing.
> Probably it is not issue for jsonb.
>
> It is not nice, but I have not better .. and it will be faster than
> any custom solution in plpgsql.
>
> Personally, I am not sure, maybe is better to fix row_to_json
>
>

No. There are several reasons for not doing this, starting with the ones
in my original email on the topic and Tom's objection to the use of
multiple default options.

This is a non-starter.

JSON parsing is actually pretty darn fast. Every json (as opposed to
jsonb) function reparses the json. It's true that this is not nearly as
fast as processing jsonb, but I think for this purpose it's probably not
too bad.

Frankly, row_to_json is not the most useful case where we could do this
anyway, so I don't think we should be looking for a heroic effort there.
I think the consensus for separate functions is the way to go.

I have made a start on coding strip_nulls functions. I'll post a patch
before too long.

cheers

andrew


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 20:06:45
Message-ID: CAFj8pRCHh=K_gHN807X7HWqLv9LTrcb_Vs7WYQLYr6mrOJZMHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-09-29 22:03 GMT+02:00 Andrew Dunstan <andrew(at)dunslane(dot)net>:

>
> On 09/29/2014 03:23 PM, Pavel Stehule wrote:
>
>>
>>
>> 2014-09-27 14:00 GMT+02:00 Stephen Frost <sfrost(at)snowman(dot)net <mailto:
>> sfrost(at)snowman(dot)net>>:
>>
>> Andrew, all,
>>
>> * Andrew Dunstan (andrew(at)dunslane(dot)net
>> <mailto:andrew(at)dunslane(dot)net>) wrote:
>> > I should have been paying a bit more attention to the recent work on
>> > adding an ignore_nulls option to row_to_json(). Here are some
>> > belated thought. I apologize to Pavel and Stephen for not having
>> > commented earlier.
>>
>> No problem at all and thanks for continuing to think about it! We
>> certainly still have quite a bit of time til 9.5 to get this right.
>>
>> > I think this is really a bandaid, and it will fail to catch lots of
>> > cases. Several examples:
>>
>> As discussed on IRC- I agree. I tend to think of JSON objects as
>> relatively simple hstore-like structures and so hadn't considered the
>> complex structure case (as I'm guessing Pavel hadn't either).
>>
>> > I think a much more comprehensive solution would be preferable. What
>> > I have in mind is something like
>> >
>> > json_strip_null_fields(json) -> json
>> >
>> > and a similar function for jsonb.
>>
>> Right, this makes sense to me.
>>
>>
>> It is better than nothing, but it is not nice for JSON due 2x parsing.
>> Probably it is not issue for jsonb.
>>
>> It is not nice, but I have not better .. and it will be faster than any
>> custom solution in plpgsql.
>>
>> Personally, I am not sure, maybe is better to fix row_to_json
>>
>>
>>
> No. There are several reasons for not doing this, starting with the ones
> in my original email on the topic and Tom's objection to the use of
> multiple default options.
>
> This is a non-starter.
>
> JSON parsing is actually pretty darn fast. Every json (as opposed to
> jsonb) function reparses the json. It's true that this is not nearly as
> fast as processing jsonb, but I think for this purpose it's probably not
> too bad.
>
> Frankly, row_to_json is not the most useful case where we could do this
> anyway, so I don't think we should be looking for a heroic effort there. I
> think the consensus for separate functions is the way to go.
>
> I have made a start on coding strip_nulls functions. I'll post a patch
> before too long.
>

ok, I have a different opinion, but it is not strong disagreement

Regards

Pavel

>
> cheers
>
> andrew
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 20:14:54
Message-ID: 10558.1412021694@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 09/29/2014 03:23 PM, Pavel Stehule wrote:
>> It is better than nothing, but it is not nice for JSON due 2x parsing.

> JSON parsing is actually pretty darn fast. Every json (as opposed to
> jsonb) function reparses the json. It's true that this is not nearly as
> fast as processing jsonb, but I think for this purpose it's probably not
> too bad.

More to the point, the way to fix any concerns about double parsing is to
create row_to_jsonb(), not to plaster a bunch of options on row_to_json().

One of the reasons I didn't like the extra option for row_to_json is that
having any such options would inevitably create confusion when we do
invent row_to_jsonb, because that will certainly not have a "pretty"
option. So row_to_json('...', true) and row_to_jsonb('...', true) would
both be accepted but they'd interpret their second arguments entirely
differently. This is not really the fault of the "ignore_null_fields"
flag, but of the "pretty" flag, which arguably should not have been there
in the first place. But looking at that precedent doesn't exactly fill
one with confidence that adding more optional arguments to row_to_json
isn't going to create even more problems down the line.

Breaking it out as a separate function seems to me to be a much better
long-term design.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 20:26:56
Message-ID: 5429C090.8040500@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/29/2014 04:14 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> On 09/29/2014 03:23 PM, Pavel Stehule wrote:
>>> It is better than nothing, but it is not nice for JSON due 2x parsing.
>> JSON parsing is actually pretty darn fast. Every json (as opposed to
>> jsonb) function reparses the json. It's true that this is not nearly as
>> fast as processing jsonb, but I think for this purpose it's probably not
>> too bad.
> More to the point, the way to fix any concerns about double parsing is to
> create row_to_jsonb(), not to plaster a bunch of options on row_to_json().

row_to_jsonb would be completely redundant with to_jsonb() in my recent
patch.

And I don't want to add options like this there for the same reasons I
didn't want them in row_to_json().

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 20:32:36
Message-ID: 10962.1412022756@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 09/29/2014 04:14 PM, Tom Lane wrote:
>> More to the point, the way to fix any concerns about double parsing is to
>> create row_to_jsonb(), not to plaster a bunch of options on row_to_json().

> row_to_jsonb would be completely redundant with to_jsonb() in my recent
> patch.

Right, which raises the question of whether we shouldn't just be
deprecating both array_to_json() and row_to_json()...

> And I don't want to add options like this there for the same reasons I
> didn't want them in row_to_json().

Agreed. IMO the place to have put the "pretty" functionality was in some
sort of json-to-text conversion function; it never belonged in an input
conversion function.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json (b) and null fields
Date: 2014-09-29 20:38:57
Message-ID: 5429C361.7060906@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 09/29/2014 04:32 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> On 09/29/2014 04:14 PM, Tom Lane wrote:
>>> More to the point, the way to fix any concerns about double parsing is to
>>> create row_to_jsonb(), not to plaster a bunch of options on row_to_json().
>> row_to_jsonb would be completely redundant with to_jsonb() in my recent
>> patch.
> Right, which raises the question of whether we shouldn't just be
> deprecating both array_to_json() and row_to_json()...
>
>> And I don't want to add options like this there for the same reasons I
>> didn't want them in row_to_json().
> Agreed. IMO the place to have put the "pretty" functionality was in some
> sort of json-to-text conversion function; it never belonged in an input
> conversion function.
>
>

Yes, if we had pretty printing functions we could deprecate and
eventually remove row_to_json and array_to_json. That's probably worth
putting on the TODO list.

cheers

andrew