Thread: A couple of TODO notes

A couple of TODO notes

From
Tom Lane
Date:
Some comments on random TODO entries:

* Allow INET subnet tests using non-constants

This should say "Allow ... to be indexed" as it's otherwise a nonissue.

* ARRAYSo -Allow arrays to be ORDER'ed

Although Joe implemented ordering operators, he didn't get around to
adding MIN()/MAX() support for arrays.  Seems like if you can do '<'
then you should be able to do MIN().

* Allow CREATE INDEX zman_index ON test (date_trunc( 'day', zman ) datetime_ops) fails index can't store constant
parameters

This is done as of 7.4.

* Improve handling of index scans for NULL

I think this should read "Allow use of indexes to search for NULLs".
ISTM "improve" implies that there's something there to improve...

* CURSORo Allow BINARY option to SELECT, just like DECLARE

This is either done or rendered irrelevant, depending on your point of
view, by the V3 protocol.
o Add SET SCHEMA

What is this supposed to do (and how's it different from SET SEARCH_PATH)?

* -Support statement-level triggers (Neil)

If we're going to remove this as done, we ought to put in a separate
TODO item to allow such triggers to get at the sets of modified rows.
People seem to think that that's a standard part of the capability.

* Wire Protocol Changeso Add optional textual message to NOTIFYo Allow fastpast to pass values in portable format

Those are both done as far as the protocol is concerned, and therefore
should be moved to some other category.  The fastpath issue probably
should be under libpq, since it's only a matter of redesigning the API
that libpq exposes for this feature.
o Special passing of binary values in platform-neutral format (bytea?)

That's done, period.
        regards, tom lane


Re: A couple of TODO notes

From
Christopher Kings-Lynne
Date:
>     o Add SET SCHEMA
> 
> What is this supposed to do (and how's it different from SET SEARCH_PATH)?

I believe someone thought it was the SQL standard way of doing it. 
Probably needs to be checked though.

Chris




Re: A couple of TODO notes

From
Tom Lane
Date:
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> o Add SET SCHEMA
>> 
>> What is this supposed to do (and how's it different from SET SEARCH_PATH)?

> I believe someone thought it was the SQL standard way of doing it. 
> Probably needs to be checked though.

I can find no mention of it in SQL99.  Given that the spec regards
schemas and users as nearly the same thing, I'd guess that SET SESSION
AUTHORIZATION is probably what they'd expect to do this.
        regards, tom lane


Re: A couple of TODO notes

From
Peter Eisentraut
Date:
Tom Lane writes:

> >> o Add SET SCHEMA
> >>
> >> What is this supposed to do (and how's it different from SET SEARCH_PATH)?
>
> > I believe someone thought it was the SQL standard way of doing it.
> > Probably needs to be checked though.
>
> I can find no mention of it in SQL99.  Given that the spec regards
> schemas and users as nearly the same thing, I'd guess that SET SESSION
> AUTHORIZATION is probably what they'd expect to do this.

SQL99 has SET PATH (part 5, clause 14.4).

-- 
Peter Eisentraut   peter_e@gmx.net



Re: A couple of TODO notes

From
Bruce Momjian
Date:
Tom Lane wrote:
> Some comments on random TODO entries:
> 
> * Allow INET subnet tests using non-constants
> 
> This should say "Allow ... to be indexed" as it's otherwise a nonissue.

New text is:
* Allow INET subnet tests to use indexes

Is that right?


> * ARRAYS
>     o -Allow arrays to be ORDER'ed
> 
> Although Joe implemented ordering operators, he didn't get around to
> adding MIN()/MAX() support for arrays.  Seems like if you can do '<'
> then you should be able to do MIN().

Added:
       o Allow MIN()/MAX() on arrays

> * Allow CREATE INDEX zman_index ON test (date_trunc( 'day', zman ) datetime_ops)
>   fails index can't store constant parameters
> 
> This is done as of 7.4.

OK.

> * Improve handling of index scans for NULL
> 
> I think this should read "Allow use of indexes to search for NULLs".
> ISTM "improve" implies that there's something there to improve...

Done.

> * CURSOR
>     o Allow BINARY option to SELECT, just like DECLARE
> 
> This is either done or rendered irrelevant, depending on your point of
> view, by the V3 protocol.

Do we allow SELECT data to come back as BINARY form (not C strings) like we do
with BINARY cursors?

>     o Add SET SCHEMA
> 
> What is this supposed to do (and how's it different from SET SEARCH_PATH)?

Per Peter's email:
       o Add SET PATH for schemas

> * -Support statement-level triggers (Neil)
> 
> If we're going to remove this as done, we ought to put in a separate
> TODO item to allow such triggers to get at the sets of modified rows.
> People seem to think that that's a standard part of the capability.

Added:
* Allow statement-level triggers to access modified rows

> * Wire Protocol Changes
>     o Add optional textual message to NOTIFY
>     o Allow fastpast to pass values in portable format
> 
> Those are both done as far as the protocol is concerned, and therefore
> should be moved to some other category.  The fastpath issue probably
> should be under libpq, since it's only a matter of redesigning the API
> that libpq exposes for this feature.

Moved.

>     o Special passing of binary values in platform-neutral format (bytea?)
> 
> That's done, period.

Updated.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: A couple of TODO notes

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> * Allow INET subnet tests using non-constants
>> This should say "Allow ... to be indexed" as it's otherwise a nonissue.

> New text is:
>     * Allow INET subnet tests to use indexes
> Is that right?

No, because we already index subnet tests against constants.  (It's pretty
much like the situation for "column LIKE anchored-pattern" --- we
transform to an indexable range-test.)

>> This is either done or rendered irrelevant, depending on your point of
>> view, by the V3 protocol.

> Do we allow SELECT data to come back as BINARY form (not C strings)
> like we do with BINARY cursors?

Yes, you can make that happen in the V3 protocol: you can select either
text or binary output format for each column.  Declaring a cursor BINARY
is in fact irrelevant in V3 protocol.
        regards, tom lane


Re: A couple of TODO notes

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> * Allow INET subnet tests using non-constants
> >> This should say "Allow ... to be indexed" as it's otherwise a nonissue.
> 
> > New text is:
> >     * Allow INET subnet tests to use indexes
> > Is that right?
> 
> No, because we already index subnet tests against constants.  (It's pretty
> much like the situation for "column LIKE anchored-pattern" --- we
> transform to an indexable range-test.)

Uh, what should be in the TODO?  I am confused.

> >> This is either done or rendered irrelevant, depending on your point of
> >> view, by the V3 protocol.
> 
> > Do we allow SELECT data to come back as BINARY form (not C strings)
> > like we do with BINARY cursors?
> 
> Yes, you can make that happen in the V3 protocol: you can select either
> text or binary output format for each column.  Declaring a cursor BINARY
> is in fact irrelevant in V3 protocol.

How is binary selected?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: A couple of TODO notes

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>>> * Allow INET subnet tests using non-constants
>>> This should say "Allow ... to be indexed" as it's otherwise a nonissue.

> Uh, what should be in the TODO?  I am confused.

"* Allow INET subnet tests using non-constants to be indexed"

>> Yes, you can make that happen in the V3 protocol: you can select either
>> text or binary output format for each column.  Declaring a cursor BINARY
>> is in fact irrelevant in V3 protocol.

> How is binary selected?

See the column format selectors in the Bind message.
        regards, tom lane


Re: A couple of TODO notes

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >>> * Allow INET subnet tests using non-constants
> >>> This should say "Allow ... to be indexed" as it's otherwise a nonissue.
> 
> > Uh, what should be in the TODO?  I am confused.
> 
> "* Allow INET subnet tests using non-constants to be indexed"

Updated.

> >> Yes, you can make that happen in the V3 protocol: you can select either
> >> text or binary output format for each column.  Declaring a cursor BINARY
> >> is in fact irrelevant in V3 protocol.
> 
> > How is binary selected?
> 
> See the column format selectors in the Bind message.

OK, removed.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073