Re:

From: John Burski <John(dot)Burski(at)911ep(dot)com>
To:
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re:
Date: 2000-12-14 21:06:15
Message-ID: 3A393647.8C51C3E0@911ep.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Just a short note on developing a coding "style".

While "order" is a reserved word in PostgreSQL, that doesn't mean that you
can't use the word for a table name, or, more precisely, part of a table name.

As an example, consider the following:

CREATE TABLE order_tbl ...

The example embeds the word "order" into the the actual name of the table
"order_tbl". This accomplishes a couple of things. First, your table name is
intuitive - it's a table that contains orders. Second, somewhere down the road
someone, maybe you, may be attempting to modify your code - since you've used
an intuitive "style" it will be easier to read and understand later.

I ran into a similar problem with column name in a table I named
"employee_tbl". As it happens, "position" is a PostgreSQL reserved word, too.
I finally chose "job_description" as the column name.

Tamsin wrote:

> i would guess that order is a reserved word, as its used in queries like
> select * from customers order by customerid
> so its probably best not to use it as a tablename.
> HTH
> tamsin
>
> > -----Original Message-----
> > From: pgsql-novice-owner(at)postgresql(dot)org
> > [mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of
> > juerg(dot)rietmann(at)pup(dot)ch
> > Sent: 14 December 2000 15:30
> > To: pgsql-novice(at)postgresql(dot)org
> > Subject: [NOVICE]
> >
> >
> > I have a question regarding a strange behaviour.
> >
> > I use postgreSQL 7.0.3 on SuSE Linux, Coldfusion 4.5.2 SP2 and the pgAdmin
> > 7.0.4. For development I use Ultradev 4.0.
> >
> > I created a database with
> >
> > createdb customer with a table order.
> >
> > The query select * from order dosn't work. Doing select * from "order" is
> > ok. When i do a query on as system table the quotes are not needed. Since
> > Ultradev builds queries without the quotes, I can't use the queries with
> > the quotes.
> >
> > Why do I need the quotes on my new defined table ? Is Encoding the point ?
> >
> > Thanks in advance ... jr
> >
> > ============================================
> > PFISTER + PARTNER, SYSTEM - ENGINEERING AG
> > Juerg Rietmann
> > Grundstrasse 22a
> > 6343 Rotkreuz
> > Switzerland
> >
> > phone: +4141 790 4040
> > fax: +4141 790 2545
> > mobile: +4179 211 0315
> > ============================================
> >
> >

--
John Burski
Chief IT Cook and Bottlewasher
911 Emergency Products, St. Cloud, MN
(320) 656 0076

++++++++++++++++++++++++++++++++++
+ How's your cheese holding out? +
++++++++++++++++++++++++++++++++++

In response to

  • RE: at 2000-12-14 19:41:21 from Tamsin

Browse pgsql-novice by date

  From Date Subject
Next Message Sandeep Joshi 2000-12-14 21:10:40 what is wrong?
Previous Message Jimi Thompson 2000-12-14 20:39:34 Unable to Create User