Re: how to amend SQL standard to add comments?

From: Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to amend SQL standard to add comments?
Date: 2012-05-10 01:06:22
Message-ID: CA+jMWocmSLQyG3pZdGfxo5_+EeS+UfFw7HDSgSnCgDa-LnKYBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, May 6, 2012 at 10:49 AM, Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:
>
> You can use multi-line comments with /* .. */ to send this information to
> the server:
>
> SELECT /* Query Author: Bob Programmer.
>          Purpose: Pull the student ID number, we'll need it to enroll the
> student for classes */
>     STUDENT_ID
> from STUDENTS
> WHERE LAST_NAME = 'Smith' and FIRST_NAME = 'Joe';

Thank you!!!! Perfect. Documenting queries is going to improve our system
tremendously. Thank you so much, Thomas!

On Sun, May 6, 2012 at 12:05 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Quite aside from the fact that the standard already has two perfectly
> good comment syntaxes

My bad. I tested using psql and --, and when I saw that the comment was
not even sent to the database (using tcpdump), I assumed /* */ would behave
the same.

Thank you for letting me know about %a in log_line_prefix to log the
application_name. It's not available in 8.4 but I look forward to using it
after we upgrade to 9 later this year.

> (2) "These comments will be thrown away by the database client" ... how
> many cases have you checked?

Only psql.

Sorry for the arrogance of my original post. I was a bit tired and agitated.

Thank you very much for the help! Made my day. What a great group.

Yours fondly,
Aleksey

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Darren Duncan 2012-05-10 05:45:58 how best to see session data in triggers, or auditing methods
Previous Message Tomas Vondra 2012-05-09 22:29:15 Re: 2 machines, same database, same query, 10 times slower?