Re: general purpose array_sort - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: general purpose array_sort
Date
Msg-id CAJ7c6TMgG5iZtpU7RydpwkF37vDYQEuay_dDEYs=6TaCi5ttiw@mail.gmail.com
Whole thread Raw
In response to Re: general purpose array_sort  (Junwang Zhao <zhjwpku@gmail.com>)
Responses Re: general purpose array_sort
List pgsql-hackers
Hi,

Thanks for the updated patch set.

> > > +Datum
> > > +array_sort_order(PG_FUNCTION_ARGS)
> > > +{
> > > +    return array_sort(fcinfo);
> > > +}
> > > +
> > > +Datum
> > > +array_sort_order_nulls_first(PG_FUNCTION_ARGS)
> > > +{
> > > +    return array_sort(fcinfo);
> > > +}
> >
> > Any reason not to specify array_sort in pg_proc.dat?
>
> It is specified in 0001 (see oid => '8810').

What I meant was that I don't think these wrapper functions are
needed. I think you can just do:

```
+{ oid => '8811', descr => 'sort array',
+  proname => 'array_sort', prorettype => 'anyarray',
+  proargtypes => 'anyarray bool', prosrc => 'array_sort'}, <--
array_sort is used directly in `prosrc`
```

... unless I'm missing something.

-- 
Best regards,
Aleksander Alekseev



pgsql-hackers by date:

Previous
From: Nikita Malakhov
Date:
Subject: Re: detoast datum into the given buffer as a optimization.
Next
From: Andres Freund
Date:
Subject: Re: AIO writes vs hint bits vs checksums