Re: quote_ident and schemas (was Re: connectby with schema)

From: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: quote_ident and schemas (was Re: connectby with schema)
Date: 2002-11-24 04:26:32
Message-ID: 20021124132022.AF3B.RK73@sea.plala.or.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Fri, 22 Nov 2002 15:21:48 -0800
Joe Conway <mail(at)joeconway(dot)com> wrote:

> OK. Attached patch removes calls within the function to quote_ident, requiring
> the user to appropriately quote their own identifiers. I also tweaked the
> regression test to deal with "value" becoming a reserved word.
>
> If it's not too late, I'd like this to get into 7.3, but in any case, please
> apply to HEAD.
>

Thank you for your quick job.

Regards,
Masaru Sugawara

-------------------------------------
CREATE SCHEMA ms;
CREATE TABLE ms.test (id int4, parent_id int4, t text);
INSERT INTO ms.test VALUES(11, null, 'aaa');
INSERT INTO ms.test VALUES(101, 11, 'bbb');
INSERT INTO ms.test VALUES(110, 11, 'ccc');
INSERT INTO ms.test VALUES(111, 110, 'ddd');
SELECT *
FROM connectby('ms.test', 'id', 'parent_id', '11', 0, '.')
as t(id int, parent_id int, level int, branch text);

id | parent_id | level | branch
-----+-----------+-------+------------
11 | | 0 | 11
101 | 11 | 1 | 11.101
110 | 11 | 1 | 11.110
111 | 110 | 2 | 11.110.111
(4 rows)

------------------------------------
CREATE SCHEMA "MS";
drop table "MS"."Test";
CREATE TABLE "MS"."Test" (id int4, parent_id int4, t text);
INSERT INTO "MS"."Test" VALUES(22, null, 'aaa');
INSERT INTO "MS"."Test" VALUES(202, 22, 'bbb');
INSERT INTO "MS"."Test" VALUES(220, 22, 'ccc');
INSERT INTO "MS"."Test" VALUES(222, 220, 'ddd');
SELECT *
FROM connectby('"MS"."Test"', 'id', 'parent_id', '22', 0, '.')
as t(id int, parent_id int, level int, branch text);

id | parent_id | level | branch
-----+-----------+-------+------------
22 | | 0 | 22
202 | 22 | 1 | 22.202
220 | 22 | 1 | 22.220
222 | 220 | 2 | 22.220.222
(4 rows)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-11-24 06:28:12 Re: Help with ADD COLUMN
Previous Message Daniele Orlandi 2002-11-24 03:27:14 Re: Optimizer & boolean syntax

Browse pgsql-patches by date

  From Date Subject
Next Message Gavin Sherry 2002-11-25 02:17:49 Re: ON COMMIT temp table handling
Previous Message Bruce Momjian 2002-11-24 03:15:50 Re: update SQL conformance