RowDescription message

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RowDescription message

Tatsuo Ishii-3
According to the manualof RowDescription message
https://www.postgresql.org/docs/12/protocol-message-formats.html

          Specifies the number of fields in a row (can be zero).

Does 0 fields could actually happen?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


Reply | Threaded
Open this post in threaded view
|

Re: RowDescription message

Andres Freund
Hi,

On 2019-10-07 17:00:24 +0900, Tatsuo Ishii wrote:
> According to the manualof RowDescription message
> https://www.postgresql.org/docs/12/protocol-message-formats.html
>
>  Specifies the number of fields in a row (can be zero).
>
> Does 0 fields could actually happen?

Yes, e.g.:

SELECT;


Reply | Threaded
Open this post in threaded view
|

Re: RowDescription message

Tatsuo Ishii-3
>> According to the manualof RowDescription message
>> https://www.postgresql.org/docs/12/protocol-message-formats.html
>>
>>  Specifies the number of fields in a row (can be zero).
>>
>> Does 0 fields could actually happen?
>
> Yes, e.g.:
>
> SELECT;

Thanks. Is it a valid SQL statement according to the standard?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


Reply | Threaded
Open this post in threaded view
|

Re: RowDescription message

Tom Lane-2
Tatsuo Ishii <[hidden email]> writes:
>>> According to the manualof RowDescription message
>>> https://www.postgresql.org/docs/12/protocol-message-formats.html
>>> Specifies the number of fields in a row (can be zero).
>>> Does 0 fields could actually happen?

>> Yes, e.g.:
>> SELECT;

> Thanks. Is it a valid SQL statement according to the standard?

See select.sgml:

  <refsect2>
   <title>Empty <literal>SELECT</literal> Lists</title>

   <para>
    The list of output expressions after <literal>SELECT</literal> can be
    empty, producing a zero-column result table.
    This is not valid syntax according to the SQL standard.
    <productname>PostgreSQL</productname> allows it to be consistent with
    allowing zero-column tables.
    However, an empty list is not allowed when <literal>DISTINCT</literal> is used.
   </para>
  </refsect2>


                        regards, tom lane


Reply | Threaded
Open this post in threaded view
|

Re: RowDescription message

Wim Bertels-3
In reply to this post by Tatsuo Ishii-3
Or
CREATE TABLE t();

SELECT *
FROM t;

Van: Tatsuo Ishii <[hidden email]>
Verzonden: maandag 7 oktober 2019 10:00
Aan: [hidden email] <[hidden email]>
Onderwerp: RowDescription message
 
According to the manualof RowDescription message
https://www.postgresql.org/docs/12/protocol-message-formats.html

          Specifies the number of fields in a row (can be zero).

Does 0 fields could actually happen?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp