chedder123
Programmer
Ok, this is my first jump into SQL/Perl stuff and I'm a little lost. I'm running PostgreSQL and already have a populated table, however I need to have an incrementing variable every time a new row is submitted. I also need a time stamp. My question is, once I already have the table created, how can I modify the variable's attributes so as to start a sequence, or tell it to do a timestamp, or add a value to a variable everytime that a new row is added. I imagine I could update table on the command line using the ALTER command, but I'm not sure of the exact syntax. If someone wouldn't mind just throwing it out at me, I'd greatly appreciate it.
Three variables:
"leadid" int4
"created" timestamptz
"export_counter" int4
I need a sequence on the leadid so it just increments the number, the timestamptz to be added everytime, and the export_counter just needs the value "0" assigned to it. Simple question. I would just create a new table, but the table already has a LOT of data already populated and I would like to just modify it without erasing the data or having to transfer all the data to a new table. Thanks
-Chad Sanders
Three variables:
"leadid" int4
"created" timestamptz
"export_counter" int4
I need a sequence on the leadid so it just increments the number, the timestamptz to be added everytime, and the export_counter just needs the value "0" assigned to it. Simple question. I would just create a new table, but the table already has a LOT of data already populated and I would like to just modify it without erasing the data or having to transfer all the data to a new table. Thanks
-Chad Sanders