Right on!

It works!

Can you point me where the mods you made are so I can copy theme on the
stable version 1.79.2 for deployment?

Thanks a lot Massimo.

Richard

2010/7/8 mdipierro <[email protected]>

> Did you try?
>
> db.define_table('test_test',
>    Field('test_id','id'),
>    Field('field1'),
>
> Field('field2'),migrate=False,sequence_name='test_test_test_id_seq')
>
> On 7 Lug, 11:01, Richard Vézina <[email protected]> wrote:
> > There is a different version number for the windows build : web2py
> Version
> > 1.79.2 (2010-07-05 23:18:02)
> >
> > I download the src build since I am under linux. Maybe the problem is
> still
> > there cause of that...
> >
> > test_test is the name of my table.
> >
> > I use this to define my model :
> >
> > db.define_table('test_test',
> >     Field('test_id','id'),
> >     Field('field1'),
> >     Field('field2'),migrate=False)
> >
> > Sequence name are generated automatically by Postgresql
> > : test_test_test_id_seq
> >
> > test_test_test_id_seq
> >
> > table name : test_test
> > table id name : test_id
> >
> > I create my database with pdAdminIII.
> >
> > Richard
> >
> > 2010/7/7 mdipierro <[email protected]>
> >
> > > Can you help debug? Is test_test_seq_Id the name of the sequence? If
> > > not, what is the name? Did you create the sequence? How did you
> > > specify the name?
> >
> > > Massimo
> >
> > > On 7 Lug, 10:48, Richard Vézina <[email protected]> wrote:
> > > > Not solving the problem :
> >
> > > > Traceback (most recent call last):
> > > >   File "/nigthly_build/web2py/gluon/restricted.py", line 178, in
> > > restricted
> > > >     exec ccode in environment
> > > >   File "/nigthly_build/web2py/applications/app/controllers/test.py"
> > > > </admin/default/edit/devGUImdg1/controllers/test.py>, line 785, in
> > > > <module>
> > > >   File "/nigthly_build/web2py/gluon/globals.py", line 96, in <lambda>
> > > >     self._caller = lambda f: f()
> > > >   File "/nigthly_build/web2py/gluon/tools.py", line 2170, in f
> > > >     return action(*a, **b)
> > > >   File "/nigthly_build/web2py/applications/
> > > > </admin/default/edit/devGUImdg1/controllers/test.py>app
> > > >
> </admin/default/edit/devGUImdg1/controllers/test.py>/controllers/test.py"
> > > > </admin/default/edit/devGUImdg1/controllers/test.py>, line 149, in
> > > > activity
> > > >     if form.accepts(request.vars, session):
> > > >   File "/nigthly_build/web2py/gluon/sqlhtml.py", line 1019, in
> accepts
> > > >     self.vars.id = self.table.insert(**fields)
> > > >   File "/nigthly_build/web2py/gluon/sql.py", line 1935, in insert
> > > >     self._db._execute("select currval('%s')" % self._sequence_name)
> > > >   File "/nigthly_build/web2py/gluon/sql.py", line 960, in <lambda>
> > > >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > ProgrammingError: ERREUR:  la relation « test_test_id_seq » n'existe
> pas
> > > > LINE 1: select currval('test_test_id_Seq')
> >
> > > > Here is the version of the web2py build I download : web2py Version
> > > > 1.79.2 (2010-07-05 23:18:02)
> >
> > > > Richard
> >
> > > > 2010/7/7 mdipierro <[email protected]>
> >
> > > > > The trunk will be the nightly built (in the link below)
> >
> > > > >http://web2py.com/examples/default/download
> >
> > > > > in 5 minutes.
> >
> > > > > On 7 Lug, 10:05, Richard Vézina <[email protected]>
> wrote:
> > > > > > I don't understand how I can download the trunk build of
> web2py...
> >
> > > > > > Maybe I am not getting it, do I have to copy only the files
> (sql.py
> > > and
> > > > > > dal.py) with the mods you had made???
> >
> > > > > > Richard
> >
> > > > > > 2010/7/1 mdipierro <[email protected]>
> >
> > > > > > > Actually the mercurial one should be in sync with bazaar one.
> > > > > > > I have had google code problems with a different project.
> >
> > > > > > > On 1 Lug, 13:04, Richard Vézina <[email protected]>
> > > wrote:
> > > > > > > > I will look at it...
> >
> > > > > > > > Do we need to be on launchpad for accessing the bazaar trunk
> > > (can't
> > > > > find
> > > > > > > the
> > > > > > > > download able package) since the mercurial seems to be out
> > > dated??
> >
> > > > > > > > Maybe I have to import it with bazaar?
> >
> > > > > > > > Richard
> >
> > > > > > > > 2010/7/1 mdipierro <[email protected]>
> >
> > > > > > > > > Hi Richard,
> >
> > > > > > > > > I am not convinced this is a good solution. The reason is
> that
> > > two
> > > > > > > > > processes perform insert at the same that may not return
> the ID
> > > of
> > > > > > > > > previous insert but the last one, therefore the same value.
> I
> > > may
> > > > > be
> > > > > > > > > wrong.
> >
> > > > > > > > > I have just added to trunk another solution:
> >
> > > > > > > > >  db.define_table(....,sequence_name='table_pk_Seq')
> >
> > > > > > > > > so that you can specify your sequence name.  This is
> compatible
> > > to
> > > > > > > > > what we do for other databases. Please check it and see if
> it
> > > works
> > > > > > > > > for you.
> >
> > > > > > > > > Massimo
> >
> > > > > > > > > On 1 Lug, 10:39, Richard Vézina <
> [email protected]>
> > > > > wrote:
> > > > > > > > > > Hello Massimo,
> >
> > > > > > > > > > I hired some guys a couples of weeks ago for fixing
> sequence
> > > name
> > > > > > > issue
> > > > > > > > > with
> > > > > > > > > > Postgres related to this thread :
> >
> > >http://groups.google.com/group/web2py/browse_thread/thread/b4577a0347.
> > > > > ..
> >
> > > > > > > > > > They come with patch to dal.py and sql.py (from the
> thread
> > > > > actually)
> > > > > > > and
> > > > > > > > > it
> > > > > > > > > > work just fine with 1.78.3... I just migrate to 1.79.2
> and
> > > the
> > > > > flaw
> > > > > > > with
> > > > > > > > > > Postgres sequence is still there. I applied again the
> patch
> > > to
> > > > > the
> > > > > > > dal.py
> > > > > > > > > > and sql.py of the 1.79.2 and it solve the problem. I am
> using
> > > > > web2py
> > > > > > > with
> > > > > > > > > > those patchs since more of a mounth and I have had no
> > > troubles.
> >
> > > > > > > > > > Do you plan to apply them in web2py in the future
> releases...
> >
> > > > > > > > > > I join my patched dal.py and sql.py of 1.79.2 version...
> >
> > > > > > > > > > Cheers
> >
> > > > > > > > > > Richard
> >
> > > > > > > > > > CC.: Lennon Rubin
> >
> > > > > > > > > > PS.: Here are the changes :
> >
> > > > > > > > > > sql.py changes around line 1935 :
> >
> > > > > > > > > > #the following was updated by Eschaton Systems for
> dynamic
> > > > > sequence
> > > > > > > > > support
> > > > > > > > > > on 5/28/2010:
> >
> > > > > > > > > >             self._db._execute("""select column_default
> from
> > > > > > > > > >
> information_schema.columns
> > > where
> > > > > > > > > > table_name='%s'; """
> > > > > > > > > > THERE IS A LINE BETWEEN HERE...
> > > > > > > > > > get_currval_string ='select ' +
> > > > > > > > > > self._db._cursor.fetchone()[0].replace('nextval',
> 'currval')
> > > > > > > > > >             self._db._execute(get_currval_string)
> >
> > > > > > > > > > dal.py changes around line 1014 :
> >
> > > > > > > > > > def lastrowid(self,tablename):
> > > > > > > > > >         #the following was updated by Eschaton Systems
> for
> > > > > dynamic
> > > > > > > > > sequence
> > > > > > > > > > support on 5/28/2010:
> >
> > > > > > > > > >         self.execute("""select column_default from
> > > > > > > > > > information_schema.columns where table_name='%s';
> > > """%tablename)
> > > > > > > > > >         get_currval_string ='select ' +
> > > > > > > > > > self.cursor.fetchone()[0].replace('nextval', 'currval')
> > > > > > > > > >         self.execute(get_currval_string)
> >
> > > > > > > > > >  dal.py
> > > > > > > > > > 189KVisualizzaScarica
> >
> > > > > > > > > >  sql.py
> > > > > > > > > > 195KVisualizzaScarica
>

Reply via email to