This is not true. In fact web2py uses the PostgreSQL auto increment feature:

create table something {
  id SERIAL PRIMARY KEY
}

This is all you need. This is even simpler the mySQL:

CREATE TABLE something (
     id MEDIUMINT NOT NULL AUTO_INCREMENT,
     PRIMARY KEY (id)
) ENGINE=InnoDB;


This for postgresql is described 
in http://www.postgresql.org/docs/8.1/static/datatype.html 8.1.4. There is 
no need for a trigger or creating a sequence manually unless you want to 
change the name of the automatically generated one associated to the 
primary key.

Massimo

On Thursday, 7 March 2013 23:00:44 UTC-6, Vineet wrote:
>
> A hitch I found with postgres is that it doesn't support autoincrement 
> field by default.
> We need to create a 'sequence' and an 'after insert trigger' for it.   :(
> Doing this for every table is tedious when the no. of tables is quite 
> large.
> (A workaround for this is to use UUID instead of autoincrement field).
>
> MySQL has built-in support for auto-increment field.    :)
> MySQL GUI tools for database administrators are very simple & intuitive 
> yet powerful.
> If one wishes, there is a "no-install" version of MySQL. Just copy/paste 
> the directory and start working (same as we do in web2py).
> There are tools such as XAMPP for this purpose. link is 
> here<http://www.apachefriends.org/en/xampp.html>
> I did not find any such thing for postgres.
>
> But otherwise, postgres is totally free for any purpose (they say that "no 
> one can sue you for using postgres for any purpose" on their website).
> MySQL, as I understand, (or rather "as I don't fully understand"), complex 
> licensing after takeover by Sun.
> One has to be very careful before distributing commercial apps using MySQL.
>

-- 

--- 
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/groups/opt_out.


Reply via email to