Re: GUID for postgreSQL - Mailing list pgsql-general

From Edwin Hernán Barrios Núñez
Subject Re: GUID for postgreSQL
Date
Msg-id 135ff5305072706373a672306@mail.gmail.com
Whole thread Raw
In response to GUID for postgreSQL  ("Riaan van der Westhuizen" <riaan@huizensoft.co.za>)
List pgsql-general
Hi Riaan.!


i think that is a better  solution, to use  the postgres native type
"serial", that  it is  a autoincremental number type. You can see it
on the postgres manual. It's very usefull because of you only need to
redifine the type of your id vars. For example, on this moment you
have

 CREATE TABLE test ( name varchar(50), id int );

 insert into test values ('prueba',newid);

On postgres you can resplace thoses

 CREATE TABLE test ( name varchar(50), id serial primary key);

 insert into test values ('prueba');

Serial type create automatically a sequence asocited to id. and always
you insert something  using its default value, the serial id
autoincrements its value.

thanks , i have not a  good english but i try to help !

Atte:
Edwin Barrios !
Gerente iBand Networks Ltda




On 7/27/05, Riaan van der Westhuizen <riaan@huizensoft.co.za> wrote:
> Hi All,
>
> We are a small developing house in South Africa, which is in the process of
> porting our Apps from
> MS SQL to PostgreSQL.  We use the newid() [globally unique identifier
> (GUID)] function in SQL a lot, and need the same for pg.
>
> Our development platform is .NET using c#.  We also plan to start using Mono
> C# in the future.
> We will be deploying PostgreSQL on Windows (2003 Server) and Linux (Ubuntu)
> platforms.
>
> We have search the web and found c code that can do this, but we do not have
> c programmers.
>
> Are there anybody that can help us compiling these for us, we need it on
> both OS's?
>
> Thanks
>
> Regards,
>
> Riaan van der Westhuizen
> CEO
>
> Huizensoft (Pty) Ltd
> Tel: +27 44 871 5534
> Fax: +2744 871 5098
>
> This e-mail and any attachments thereto is confidential and
> is intended solely for the use of the addressee's.
> If you are not the intended recipient, be advised that any use,
> dissemination, forwarding, printing, or copying of this e-mail is strictly
> prohibited.
>
> Huizensoft (Pty) Ltd accepts no liability for any views or opinions
> expressed in
> this e-mail or for any loss or damages that may be suffered by any person
> whomsoever, arising from, or in connection with, or caused by, the use of
> this e-mail.
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

pgsql-general by date:

Previous
From: "DracKewl"
Date:
Subject: Select Stament Issue??
Next
From: mark reid
Date:
Subject: Re: dropping non-existent tables