Thread: Identifying comments

Identifying comments

From
Rich Shepard
Date:
I know that "--" has been the single-line comment identifier since SQL was
implemented by IBM on mainframes using Hollerith cards. Today, some RDBMSs
also allow the C comment indentifier pair, /* ... */.

The postgres10 manual when searched for 'comments' presents the double
hyphens and, in Section 4.1.3, on the top line of page 39, I read that "--
and /* cannot appear anywhere in an operator name, since they will be taken
as the start of a comment."

I want only to confirm that I can use /* ... */ for multiline comments in my
DDL and DML scripts.

TIA,

Rich



Re: Identifying comments [ANSWERED]

From
Rich Shepard
Date:
On Thu, 17 Jan 2019, Rich Shepard wrote:

> I want only to confirm that I can use /* ... */ for multiline comments in my
> DDL and DML scripts.

Oops! Section 4.1.5 tells me that I can.

Apologies to all,

Rich


Re: Identifying comments [ANSWERED]

From
"David G. Johnston"
Date:
On Thu, Jan 17, 2019 at 8:39 AM Rich Shepard <rshepard@appl-ecosys.com> wrote:
>
> On Thu, 17 Jan 2019, Rich Shepard wrote:
>
> > I want only to confirm that I can use /* ... */ for multiline comments in my
> > DDL and DML scripts.
>
> Oops! Section 4.1.5 tells me that I can.
>

You could also just try it...

select 1 /* comment */ AS col_one

executes just fine...

David J.