Search Postgresql Archives

Re: Quotes, double quotes...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On nie, wrz 29, 2013 at 02:09:54 +0100, António M. Rodrigues wrote:
> The code is the following:
> 
> -----------------------------------------------------
> DO $$
> DECLARE
>     i integer;
> BEGIN
> FOR i IN (select nn from numeros)
> LOOP
> EXECUTE
> 'create table contagio' || i || ' as
> SELECT *
>  FROM pgr_drivingdistance("


" character is not for strings - it's for identifiers.

if you want to have string within string you have following options:
a. multiply ' - i.e. use '' (not ")
b. use $ quotation

so you can:
execute 'whatever ''sub string'' anything ';
or
execute 'whatever $sub$sub string$sub$';

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux