pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <barwick@gmx.net>
To: jack <datactrl@tpg.com.au>
To: pgsql-sql@postgresql.org
Subject: Re: EXECUTE problem on schema
Date: Fri, 28 Mar 2003 09:34:59 +0100
Message-ID: <200303280934.59317.barwick@gmx.net> (raw)
In-Reply-To: <004501c2f4c5$5116f970$1400a8c0@jac>
References: <000f01c2f403$c6fc7bf0$1400a8c0@jac>
	<200303271111.24745.barwick@gmx.net>
	<004501c2f4c5$5116f970$1400a8c0@jac>

On Friday 28 March 2003 01:59, jack wrote:

(...)
>  And the following are the example.

Aha, the problem is not EXECUTE but QUOTE_IDENT:

  test=# SELECT quote_ident('public.test_j2');
     quote_ident    
  ------------------
   "public.test_j2"
  (1 row)

  test=# SELECT * FROM "public.test_j2";
  ERROR:  Relation "public.test_j2" does not exist

which is correct, because schema and relation names can contain periods.
To quote a schema-qualified relation name you need something like
"public"."test_j2" (or "public"."table.with_period_in_name") which
quote_indent can't handle because it doesn't know whether the
period is a schema / relation name divider or part of the relation name.

This has come up before, see:
http://archives.postgresql.org/pgsql-hackers/2002-11/msg00892.php

It would probably be easiest to leave out the quote_ident from your
function definition and do the quoting manually in the function call,
if necessary, which mostly isn't.

Ian Barwick
barwick@gmx.net




view thread (4+ messages)

Message-ID: <200303280934.59317.barwick@gmx.net>
Permalink:  ../200303280934.59317.barwick@gmx.net/
Also on:    postgresql.org/message-id/200303280934.59317.barwick@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barwick@gmx.net, datactrl@tpg.com.au
  Subject: Re: EXECUTE problem on schema
  In-Reply-To: <200303280934.59317.barwick@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox