Thank you! for getting back Dave and pointing me to this page -
I used it for *state *field name and it did *not *work for me.
Field('state', rname='state_country'),
Give me below syntax error still -
*SyntaxError*: invalid table/column name "state" is a "POSTGRES_NONRESERVED"
reserved SQL/NOSQL keyword
Am I using it properly ?
*Rahul *
------------------------
On Tuesday, July 24, 2018 at 2:15:42 AM UTC+5:30, Dave S wrote:
>
>
>
> On Sunday, July 22, 2018 at 10:28:46 PM UTC-7, Rahul wrote:
>>
>> Hey everyone,
>> Any clues on this one? OR should I start updating the
>> application and the models with unused field names? Please let me know
>>
>>
>>
> Does 'rname' help? You have to poke a bit in the book to find it at field
> level, but when you do it says
>
> "rname provides the field was a "real name", a name for the field known
> to the database adapter; when the field is used, it is the rname value
> which is sent to the database. The web2py name for the field is then
> effectively an alias."
>
> <URL:
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor
> >
>
> See also
> <URL:https://groups.google.com/d/msg/web2py/X52AnJIQj_o/VnxIJcyNAwAJ>
> <URL:https://groups.google.com/d/msg/web2py/mVsTN7QLQ1M/QxaT3ObZAgAJ>
>
> /dps
>
>
>> On Friday, July 20, 2018 at 12:40:04 PM UTC+5:30, Rahul wrote:
>>>
>>> Hello All,
>>> I am migrating my project from SQLite to POSTGRESQL -
>>> I have a few field names and table names that seem to be a part of
>>> reserver/non-serverved POSTGRES keywords - For example, field name = *state
>>>
>>> (Field('state', .. )*, *Field('notify', 'boolean', label='Add
>>> Notification?', ), *
>>>
>>> Now I get below errors as highlighted below
>>>
>>>
>>> *My question is *- Is there a work around to make these names work some
>>> how ? (backticks or something I found on the web but how do I use it under
>>> DAL ? ) Also, I could not find anything about *rname* in the web2py
>>> documentation.. Any idea if / how it can help in this case ?
>>>
>>> *Ironically - *
>>>
>>> Initially I had db= ... check_reserved=['all'] and it never gave me the
>>> exception in SQLite but as soon as I switched it started giving me this.
>>> which I believe it shoudl have shown me even when I ws in SQLite. Is that
>>> an issue ?
>>>
>>> *<type 'exceptions.SyntaxError'> invalid table/column name "state" is a
>>> "ALL" reserved SQL/NOSQL keyword*
>>>
>>> & when I added
>>>
>>> *check_reserved=['postgres', 'postgres_nonreserved'**]* and now it is
>>> showing this error (Which is to the point)
>>>
>>> <type 'exceptions.SyntaxError'> invalid table/column name "state" is a
>>> "POSTGRES_NONRESERVED" reserved SQL/NOSQL keyword
>>>
>>>
>>> Please suggest how I can get rid of this issue
>>>
>>> Rahul
>>>
>>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.