Thread: reg:create database
Hi...
I want to have a database/table with dot( . ) in its name.But i am unable to create a database with a dot in the middle of its name..Is there any possibility of doing it?If yes pls tell me.
Thank you,
Sandhya
On Mon, Mar 27, 2006 at 12:11:40PM +0530, sandhya wrote: > I want to have a database/table with dot( . ) in its name.But > i am unable to create a database with a dot in the middle of its > name..Is there any possibility of doing it?If yes pls tell me. See the documentation regarding quoted identifiers. http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS -- Michael Fuhr
Dear Michale.. I am unable to get answer from the link you sent...Just tell me whether it is possible or not. In the document they mentioned that . is used as a seperator for a table/column name...So Is it any way to use dot while creating a table/database ----- Original Message ----- From: "Michael Fuhr" <mike@fuhr.org> To: "sandhya" <sandhyar@amiindia.co.in> Cc: "Postgres" <pgsql-admin@postgresql.org> Sent: Monday, March 27, 2006 12:15 PM Subject: Re: [ADMIN] reg:create database > On Mon, Mar 27, 2006 at 12:11:40PM +0530, sandhya wrote: > > I want to have a database/table with dot( . ) in its name.But > > i am unable to create a database with a dot in the middle of its > > name..Is there any possibility of doing it?If yes pls tell me. > > See the documentation regarding quoted identifiers. > > http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS > > -- > Michael Fuhr > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >
> In the document they mentioned that . is used as a seperator for a > table/column name I would say for this very reason the answer would be No, but I might be wrong... Andy
Sandhya, Hope this will explain, why it is so ... http://www.postgresql.org/docs/7.4/static/ddl-schemas.html Kannan Andy Shellam wrote: >> In the document they mentioned that . is used as a seperator for a >> table/column name >> > > I would say for this very reason the answer would be No, but I might be > wrong... > > Andy > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > > > -- GSEC1 (A Division of ITAC UK Limited) Chennai, India | Manchester, UK Tel : +91 44 4202 2601 - 2605 Fax : +91 44 4202 2606 Mobile : +91 988411 4931 URL : www.gsec1.com ****** This email is confidential and is intended for the original recipient(s) only. If you have erroneously received thismail, please delete it immediately and notify the sender. Unauthorised copying, disclosure or distribution of the materialin this mail is prohibited. Views expressed in this mail are those of the individual sender and do not bind GSec1(A Division of ITAC UK Limited) or its subsidiary, unless the sender has done so expressly with due authority of GSec1(A Division of ITAC UK Limited).******
Attachment
On Mon, Mar 27, 2006 at 03:03:38PM +0530, sandhya wrote: > Dear Michale.. > I am unable to get answer from the link you sent...Just tell me whether > it is possible or not. > In the document they mentioned that . is used as a seperator for a > table/column name...So Is it any way to use dot while creating a > table/database decibel=# create database "dot.test"; CREATE DATABASE decibel=# \c "dot.test" You are now connected to database "dot.test". dot.test=# Now, just because you can do this doesn't mean it's a very good idea... -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
oh.....ok Now, just because you can do this doesn't mean it's a very good idea... Why? ----- Original Message ----- From: "Jim C. Nasby" <jnasby@pervasive.com> To: "sandhya" <sandhyar@amiindia.co.in> Cc: "Michael Fuhr" <mike@fuhr.org>; "Postgres" <pgsql-admin@postgresql.org> Sent: Monday, March 27, 2006 4:08 PM Subject: Re: [ADMIN] reg:create database > On Mon, Mar 27, 2006 at 03:03:38PM +0530, sandhya wrote: > > Dear Michale.. > > I am unable to get answer from the link you sent...Just tell me whether > > it is possible or not. > > In the document they mentioned that . is used as a seperator for a > > table/column name...So Is it any way to use dot while creating a > > table/database > > decibel=# create database "dot.test"; > CREATE DATABASE > decibel=# \c "dot.test" > You are now connected to database "dot.test". > dot.test=# > > Now, just because you can do this doesn't mean it's a very good idea... > -- > Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com > Pervasive Software http://pervasive.com work: 512-231-6117 > vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings >
You can throw your computer out of a 10-story window - but just because you can do it doesn't mean it's a good idea. It's just wrong. In your particular case it depends on whichever library/ interface/ application you're using to communicate with PG (e.g. PGSQL manager, the dump and restore tools, PHP's library, libpq.dll etc) - as they will all have to realise that there is a dot in the table/column name, and will have to quote it, or PG will complain. And you'll have to remember to quote it too when manually writing queries - it's just extra work that's plain unnecessary. Plus if/when you encounter problems in the future, the first thing that people are going to see is the dot in the table/column names and question if that's what is causing the problem, as in problem-solving you always look for the obvious first. Why are you so insistent you want to use a dot? Can't you use underscores instead? Andy -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of sandhya Sent: Monday, 27 March, 2006 12:27 PM To: Jim C. Nasby Cc: Michael Fuhr; Postgres Subject: Re: [ADMIN] reg:create database oh.....ok Now, just because you can do this doesn't mean it's a very good idea... Why?
On Mon, Mar 27, 2006 at 04:57:29PM +0530, sandhya wrote: > > > In the document they mentioned that . is used as a seperator for a > > > table/column name...So Is it any way to use dot while creating a > > > table/database > > > > decibel=# create database "dot.test"; > > CREATE DATABASE > > decibel=# \c "dot.test" > > You are now connected to database "dot.test". > > dot.test=# > > > > Now, just because you can do this doesn't mean it's a very good idea... > oh.....ok > Now, just because you can do this doesn't mean it's a very good idea... > Why? Because it's likely to lead to confusion, since SQL uses dots as seperators between databases, schemas, and objects; ie: databasename.schemaname.tablename.columname. Granted, PostgreSQL doesn't (currently) allow you to do per-database specifications, but that could change. In any case, it's asking for trouble. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461