Re: Serial columns in PostgreSQL

[prev] [thread] [next] [Date index for 2004/11/29]

From: Dana Hudes
Subject: Re: Serial columns in PostgreSQL
Date: 16:07 on 29 Nov 2004
RTFM. You have a sequence. Declare it and CDBI will Do The Right Thing.

On Mon, 29 Nov 2004, JJ Merelo wrote:

> Hi,
> This is probably a FAQ, but I haven't found a mesage that mentions it.
> I have this table:
> create table persona(
>     	persona_id	serial not null primary key,
> 	persona_name	varchar(255) not null,
> 	persona_surname	varchar(255) not null,
> 	persona_password	varchar(20) not null,
> 	persona_email	varchar(255) not null,
> 	persona_url	varchar(255),
> 	unique( persona_id, persona_email )
> );
> 
> With this module:
> package My::CEDI::Persona;
> 
> use lib '../..';
> use base 'My::CEDI';
> 
> our ($VERSION) = ('$Revision: 1.2 $' =~ /(\d+\.\d+)/ );
> our $prefijo = 'persona'; #Se quita del nombre de las columnas para
> dar los accesores
> 
> __PACKAGE__->table('persona');
> __PACKAGE__->columns( All => qw(  persona_id persona_name
> persona_surname persona_password persona_email persona_url ) );
> 
> --
> 
> How can I convince Class::DBI that it should leave the database handle
> the persona_id auto-increment column?
> 
> Should I just leave it off the "All" columns?
> 
> JJ
> 

Serial columns in PostgreSQL
JJ Merelo 13:10 on 29 Nov 2004

Re: Serial columns in PostgreSQL
Dana Hudes 16:07 on 29 Nov 2004

Re: Serial columns in PostgreSQL
Dana Hudes 16:39 on 29 Nov 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52