Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Vineet Deodhar
Thanks all for your replies. This is my first experience with postgres mailing list. Hats Off to the active community of pgsql. This has definitely raised my confidence level with postgres. --- Vineet

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Vineet Deodhar
. As per your advise, let me put smallint into practice and analyze the storage requirement. Thanks a lot. -- Vineet -- Best regards, Vineet Deodhar 0 9270012422( Sales) 0 9420 6767 41 / 0 844 6268 488 (Service) 0233-2300136 (Back-Office)

Re: [GENERAL] auto-increment field : in a simple way

2012-10-11 Thread Vineet Deodhar
On Thu, Oct 11, 2012 at 12:56 PM, Scott Marlowe wrote: > > Can't you just add this to your create table: > > > CREATE TABLE tablename ( >colname SERIAL > , check (colname>0 and colname < 32768)); > ); > > > With this constraint, whether the storage space requirement would reduce? OR Is it just

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Vineet Deodhar
On Thu, Oct 11, 2012 at 1:12 PM, Craig Ringer wrote: > The difference between SMALLINT and BOOLEAN (or TINYINT if Pg supported > it) is 1 byte per column. If you had 30 smallint columns and quite a few > million rows it might start making a difference, but it's *really* not > worth obsessing abou

[GENERAL] auto-increment field : in a simple way

2012-10-11 Thread Vineet Deodhar
I wish to know regarding auto-increment field. I learn that the required table definition would be something like -- CREATE TABLE tablename ( colname SERIAL ); For more granular control over the size of field, I need to do the following--- CREATE SEQUENCE user_id_seq; CREATE TABLE user (

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Vineet Deodhar
On Thu, Oct 11, 2012 at 5:26 AM, Ondrej Ivanič wrote: > Hi, > > On 10 October 2012 19:47, Vineet Deodhar wrote: > > 3) Can I simulate MySQL's TINYINT data-type (using maybe the custom data > > type or something else) > > What do you exactly mean? Do you ca

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Vineet Deodhar
On Wed, Oct 10, 2012 at 2:38 PM, Chris Travers wrote: > > > On Wed, Oct 10, 2012 at 1:47 AM, Vineet Deodhar > wrote: PostgreSQL has an excellent optimizer and > the on-disk layout is > completely different. This will dwarf any changes due to threads vs > queries. >