Обсуждение: $Body$

Поиск
Список
Период
Сортировка

$Body$

От
bilal ghayyad
Дата:
Hi List;

What does it mean the $BODY$ when writing the function? In other words: why to use the $ sign?

Regards
Bilal




Re: $Body$

От
Christophe Pettus
Дата:
It's just a string constant:

    http://www.postgresql.org/docs/8.4/interactive/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS

It could be anything between the dollar signs, but BODY is self-
documenting.

On Aug 30, 2009, at 3:37 PM, bilal ghayyad wrote:

> Hi List;
>
> What does it mean the $BODY$ when writing the function? In other
> words: why to use the $ sign?
>
> Regards
> Bilal
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

--
-- Christophe Pettus
    xof@thebuild.com


Re: $Body$

От
David Fetter
Дата:
On Sun, Aug 30, 2009 at 03:37:56PM -0700, bilal ghayyad wrote:
> Hi List;
>
> What does it mean the $BODY$ when writing the function?  In other
> words: why to use the $ sign?

See
http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Re: $Body$

От
bilal ghayyad
Дата:
This is the idea david:

Why in the constant string we use the tag and we do not use the tag in the BODY?

In other wrods, why we write it $BODY$ and does not write it as $q$BODY$q$ or as $$BODY$$?

Also why in the single-quote syntax, each backslash will be written as four backslashes? While this will not be needed
inthe dolar-quoted string? 

Regards
Bilal

--- On Sun, 8/30/09, David Fetter <david@fetter.org> wrote:

> From: David Fetter <david@fetter.org>
> Subject: Re: [GENERAL] $Body$
> To: "bilal ghayyad" <bilmar_gh@yahoo.com>
> Cc: pgsql-general@postgresql.org
> Date: Sunday, August 30, 2009, 6:44 PM
> On Sun, Aug 30, 2009 at 03:37:56PM
> -0700, bilal ghayyad wrote:
> > Hi List;
> >
> > What does it mean the $BODY$ when writing the
> function?  In other
> > words: why to use the $ sign?
>
> See
> http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING
>
> Cheers,
> David.
> --
> David Fetter <david@fetter.org>
> http://fetter.org/
> Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!:
> dfetter
> Skype: davidfetter      XMPP: david.fetter@gmail.com
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>




Re: $Body$

От
David Fetter
Дата:
On Sun, Aug 30, 2009 at 04:13:18PM -0700, bilal ghayyad wrote:
> This is the idea david:
>
> Why in the constant string we use the tag and we do not use the tag
> in the BODY?
>
> In other wrods, why we write it $BODY$ and does not write it as
> $q$BODY$q$ or as $$BODY$$?

The string BODY in $BODY$ has no syntactical significance.  You could
just as easily use $$ or $supercalifragilisticexpialidocious$.  The
only place where the string inside matters is when you're nesting
dollar quoted structures.

> Also why in the single-quote syntax, each backslash will be written
> as four backslashes?  While this will not be needed in the
> dolar-quoted string?

Dollar quoting was specifically invented so that people would not have
to use torrents of backslashes and/or single quotes.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate