Quotes and spaces - Mailing list pgsql-sql

From Oleg Lebedev
Subject Quotes and spaces
Date
Msg-id 3BBE340A.B8788CAE@waterford.org
Whole thread Raw
In response to Re: Why the weak key is created as unique  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Quotes and spaces  ("Josh Berkus" <josh@agliodbs.com>)
Re: Quotes and spaces  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
Hi,
I looked through PL/pgSQL tutorial, but I can't get quotes and spaces to
work in queries executed from Pl/pgSQl. Here is an example:

create procedure get_name(varchar)
...
BEGIN   query := ''SELECT first_name || '''' '''' || last_name FROM user'';   EXECUTE query;
...
END;
...

Basically I want to get full name, i.e. first name separated with space from
the last name. If I follow the PL/pgSQL manual as shown above, I get parse
error.
What am I doing wrong?
thanks,

Oleg




pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: SQL CONSTRAINTS - Constraining time values from two
Next
From: "Josh Berkus"
Date:
Subject: Re: Quotes and spaces