Обсуждение: " keywords... Is it normal ?
Hi, just noticed something I was not used to see. Is it normal that some postgre keywords are quoted ? http://www.enrici.com/pgadmin/SCREENSHOTS/Scr-1.1.0.20040908.png Regards, Raphaël
Raphaël Enrici wrote: > Hi, > > just noticed something I was not used to see. Is it normal that some > postgre keywords are quoted ? > http://www.enrici.com/pgadmin/SCREENSHOTS/Scr-1.1.0.20040908.png > Note that it gives me a sql source which is unusable in the query window... Example: -- Table: pages DROP TABLE pages; CREATE TABLE pages ( page "varchar"(50) NOT NULL DEFAULT ''::character varying, content oid NOT NULL, changetime "timestamp" NOT NULL ) WITH OIDS; GRANT ALL ON TABLE pages TO ralph WITH GRANT OPTION; GRANT ALL ON TABLE pages TO GROUP "\""www-data\""";
Raphaël Enrici wrote: > Raphaël Enrici wrote: > >> Hi, >> >> just noticed something I was not used to see. Is it normal that some >> postgre keywords are quoted ? >> http://www.enrici.com/pgadmin/SCREENSHOTS/Scr-1.1.0.20040908.png >> > > Note that it gives me a sql source which is unusable in the query > window... Example: Sorry to insist... but I was not clear enough. Here is my original sql source: -- Table: pages DROP TABLE pages; CREATE TABLE pages ( page varchar(50) NOT NULL DEFAULT '', content bytea NOT NULL, changetime timestamp NOT NULL ) WITH OIDS; GRANT ALL ON TABLE pages TO ralph WITH GRANT OPTION; GRANT ALL ON TABLE pages TO GROUP "www-data"; I run it in the query window and then look at it in the schema browser and re-open it in the query window... it gives the following source which is unusable: -- Table: pages -- DROP TABLE pages; CREATE TABLE pages ( page "varchar"(50) NOT NULL DEFAULT ''::character varying, content bytea NOT NULL, changetime "timestamp" NOT NULL ) WITH OIDS; GRANT ALL ON TABLE pages TO ralph WITH GRANT OPTION; GRANT ALL ON TABLE pages TO GROUP "\""www-data\"""; Known one ? Regards, Raphaël
Hi, I have the some trouble in Fedora Core 2, with a cvs tree checked out yesterday. I thougth that it was working OK, until I tried to make a new table. These bug make pgadmin3 almost unusable. It's strange that nobody else complains !. I will try to find what changed from my last working snapshot. Diego. El jue, 09-09-2004 a las 17:29, Raphaël Enrici escribió: > Raphaël Enrici wrote: > > Raphaël Enrici wrote: > > > >> Hi, > >> > >> just noticed something I was not used to see. Is it normal that some > >> postgre keywords are quoted ? > >> http://www.enrici.com/pgadmin/SCREENSHOTS/Scr-1.1.0.20040908.png > >> > > > > Note that it gives me a sql source which is unusable in the query > > window... Example: > Sorry to insist... but I was not clear enough. > > Here is my original sql source: > > -- Table: pages > > DROP TABLE pages; > > CREATE TABLE pages > ( > page varchar(50) NOT NULL DEFAULT '', > content bytea NOT NULL, > changetime timestamp NOT NULL > ) > WITH OIDS; > GRANT ALL ON TABLE pages TO ralph WITH GRANT OPTION; > GRANT ALL ON TABLE pages TO GROUP "www-data"; > > I run it in the query window and then look at it in the schema browser > and re-open it in the query window... it gives the following source > which is unusable: > -- Table: pages > > -- DROP TABLE pages; > > CREATE TABLE pages > ( > page "varchar"(50) NOT NULL DEFAULT ''::character varying, > content bytea NOT NULL, > changetime "timestamp" NOT NULL > ) > WITH OIDS; > GRANT ALL ON TABLE pages TO ralph WITH GRANT OPTION; > GRANT ALL ON TABLE pages TO GROUP "\""www-data\"""; > > Known one ? > > Regards, > Raphaël > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > >
Hi all, It seems that the only "quoted" types are : SET any bit char interval numeric time timestamp trigger unknown varchar that makes any sense for anyone ? Other types, like int2, int4, date, text, etc don't get quotes. Diego. El jue, 09-09-2004 a las 17:29, Raphaël Enrici escribió: > Raphaël Enrici wrote: > > Raphaël Enrici wrote: > > > >> Hi, > >> > >> just noticed something I was not used to see. Is it normal that some > >> postgre keywords are quoted ? > >> http://www.enrici.com/pgadmin/SCREENSHOTS/Scr-1.1.0.20040908.png > >> > > > > Note that it gives me a sql source which is unusable in the query > > window... Example: > Sorry to insist... but I was not clear enough. > > Here is my original sql source: > > -- Table: pages > > DROP TABLE pages; > > CREATE TABLE pages > ( > page varchar(50) NOT NULL DEFAULT '', > content bytea NOT NULL, > changetime timestamp NOT NULL > ) > WITH OIDS; > GRANT ALL ON TABLE pages TO ralph WITH GRANT OPTION; > GRANT ALL ON TABLE pages TO GROUP "www-data"; > > I run it in the query window and then look at it in the schema browser > and re-open it in the query window... it gives the following source > which is unusable: > -- Table: pages > > -- DROP TABLE pages; > > CREATE TABLE pages > ( > page "varchar"(50) NOT NULL DEFAULT ''::character varying, > content bytea NOT NULL, > changetime "timestamp" NOT NULL > ) > WITH OIDS; > GRANT ALL ON TABLE pages TO ralph WITH GRANT OPTION; > GRANT ALL ON TABLE pages TO GROUP "\""www-data\"""; > > Known one ? > > Regards, > Raphaël > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > >
----Message d'origine---- >Sujet: Re: [pgadmin-hackers] " keywords... Is it normal ? >De: "Diego A. Gil" <diego@adminsa.com> >A: Raphaël Enrici <blacknoz@club-internet.fr> >Copie à: Andreas Pflug <pgadmin@pse-consulting.de>, >Date: Fri, 10 Sep 2004 01:28:41 -0300 > >Hi all, > >It seems that the only "quoted" types are : > >SET >any >bit >char >interval >numeric >time >timestamp >trigger >unknown >varchar > Also add the user name in the grant statements. I've read some thread implying Andreas and quoted keywords. I think Andreas or Dave added such feature to prevent some misbehaviour while using reserved words in some conditions butI don't know/remember/understand the scope of these modifications. IMHO it should be reviewed as it breaks part of the tool. Cheers, Raphaël
> -----Original Message----- > From: blacknoz@club-internet.fr [mailto:blacknoz@club-internet.fr] > Sent: 10 September 2004 10:03 > To: diego@adminsa.com > Cc: pgadmin@pse-consulting.de; Dave Page; > pgadmin-hackers@postgresql.org > Subject: Re: Re: [pgadmin-hackers] " keywords... Is it normal ? > > > Also add the user name in the grant statements. > I've read some thread implying Andreas and quoted keywords. > I think Andreas or Dave added such feature to prevent some > misbehaviour while using reserved words in some conditions > but I don't know/remember/understand the scope of these modifications. > IMHO it should be reviewed as it breaks part of the tool. Andreas tweaked it a bit a little while ago: http://cvs.pgadmin.org/cgi-bin/viewcvs.cgi/pgadmin3/src/utils/misc.cpp.d iff?r1=1.54&r2=1.55 Seems we need a way to exclude keywords when used in their 'keyword defining' context (if that makes any sense :-) ). Regards, Dave
hi! in my case it also quotes only 1 column name (column name is "type"), although it is lower-case: http://mcajvar.prkoritu.net/pgadmin/pgadmin_quotes.png (in the middle of the query). in another table, the column name "password" is also quoted and it's also lower-case. using v 1.1.0 devel, sep. 7 2004 on win2k. regards, M Dave Page wrote: > > > >>-----Original Message----- >>From: blacknoz@club-internet.fr [mailto:blacknoz@club-internet.fr] >>Sent: 10 September 2004 10:03 >>To: diego@adminsa.com >>Cc: pgadmin@pse-consulting.de; Dave Page; >>pgadmin-hackers@postgresql.org >>Subject: Re: Re: [pgadmin-hackers] " keywords... Is it normal ? >> >> >>Also add the user name in the grant statements. >>I've read some thread implying Andreas and quoted keywords. >>I think Andreas or Dave added such feature to prevent some >>misbehaviour while using reserved words in some conditions >>but I don't know/remember/understand the scope of these modifications. >>IMHO it should be reviewed as it breaks part of the tool. > > > Andreas tweaked it a bit a little while ago: > > http://cvs.pgadmin.org/cgi-bin/viewcvs.cgi/pgadmin3/src/utils/misc.cpp.d > iff?r1=1.54&r2=1.55 > > Seems we need a way to exclude keywords when used in their 'keyword > defining' context (if that makes any sense :-) ). > > Regards, Dave > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match >
Dave Page wrote: > > > >>-----Original Message----- >>From: blacknoz@club-internet.fr [mailto:blacknoz@club-internet.fr] >>Sent: 10 September 2004 10:03 >>To: diego@adminsa.com >>Cc: pgadmin@pse-consulting.de; Dave Page; >>pgadmin-hackers@postgresql.org >>Subject: Re: Re: [pgadmin-hackers] " keywords... Is it normal ? >> >> >>Also add the user name in the grant statements. >>I've read some thread implying Andreas and quoted keywords. >>I think Andreas or Dave added such feature to prevent some >>misbehaviour while using reserved words in some conditions >>but I don't know/remember/understand the scope of these modifications. >>IMHO it should be reviewed as it breaks part of the tool. > > > Andreas tweaked it a bit a little while ago: > > http://cvs.pgadmin.org/cgi-bin/viewcvs.cgi/pgadmin3/src/utils/misc.cpp.d > iff?r1=1.54&r2=1.55 > > Seems we need a way to exclude keywords when used in their 'keyword > defining' context (if that makes any sense :-) ). Yeah, seems I introduced more problems than fixing. Just introduced qtTypeIdent which will not quote types that are known to the parser. Anybody is invited to review the list in needsQuoting (utils/misc.c) taken from include/parser/parse.h. Diego's list was a starter, but by far not complete. IMHO quoting column names that are keywords should remain, to indicate to the user that he's doing something he might want to review. Regards, Andreas