Re: column name is "LIMIT"

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Gourish Singbal <gourish(at)gmail(dot)com>, Russell Smith <mr-russ(at)pws(dot)com(dot)au>, pgsql-performance(at)postgresql(dot)org
Subject: Re: column name is "LIMIT"
Date: 2005-03-14 18:55:50
Message-ID: 4235DE36.2070608@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 3/14/2005 1:28 PM, Robert Treat wrote:

> Yeah... how come no one told him "don't do that"? LIMIT is an SQL
> reserved word, so it's likely to cause trouble in any database you try
> to use it on... I'd strongly recommend renaming that column asap. You
> can see other reserved words at
> http://www.postgresql.org/docs/8.0/interactive/sql-keywords-appendix.html
>
> Robert Treat

Note also that the Slony-I replication system has problems with column
names identical to reserved words. This is rooted in the fact that the
quote_ident() function doesn't quote reserved words ... as it IMHO is
supposed to do.

Jan

>
> On Mon, 2005-03-14 at 03:55, Christopher Kings-Lynne wrote:
>> You will still need to use double quotes in 8.0.1...
>>
>> Chris
>>
>> Gourish Singbal wrote:
>> > Thanks a lot,
>> >
>> > we might be upgrading to 8.0.1 soon.. till than using double quotes
>> > should be fine.
>> >
>> > regards
>> > gourish
>> >
>> > On Mon, 14 Mar 2005 18:25:22 +1100, Russell Smith <mr-russ(at)pws(dot)com(dot)au> wrote:
>> >
>> >>On Mon, 14 Mar 2005 06:14 pm, Gourish Singbal wrote:
>> >>
>> >>>Guys,
>> >>>
>> >>>I am having a problem firing queries on one of the tables which is
>> >>>having "limit" as the column name.
>> >>>
>> >>>If a run an insert/select/update command on that table i get the below error.
>> >>>
>> >>>ERROR: syntax error at or near "limit" at character 71
>> >>
>> >>select "limit" from limit_table WHERE "limit" < 50 LIMIT 2;
>> >>
>> >>You need to quote the field name, and make sure the case is correct.
>> >>
>> >>>Any Help would be realyl great to solve the problem.
>> >>>
>> >>>postgresql 7.4.5 and linux OS
>> >>>
>> >>
>> >>You should probably upgrade to 7.4.7
>> >>
>> >>Regards
>> >>
>> >>Russell Smith.
>> >>
>> >
>> >
>> >
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 2: you can get off all lists at once with the unregister command
>> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Miroslav Šulc 2005-03-14 19:11:43 Re: Avoiding tuple construction/deconstruction during joining
Previous Message Arshavir Grigorian 2005-03-14 18:54:44 Re: Postgres on RAID5