Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group