pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedDatabase conversion type serial question
2+ messages / 2 participants
[nested] [flat]
* Database conversion type serial question
@ 2008-03-14 15:05 Carol Walter <walterc@indiana.edu>
0 siblings, 1 reply; 2+ messages in thread
From: Carol Walter @ 2008-03-14 15:05 UTC (permalink / raw)
To: pgsql-admin
I'm converting a database developed by a group of students from
Oracle to Postgres. There are fields that should be primary keys
using sequences. I can get the primary keys designated but when I
try to change the type from integer to serial I get an error saying
that 'type "serial" does not exist. Can I designate a column not
previously defined as serial to serial. It was a sequence on the
Oracle database that I'm converting it from.
Carol
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Database conversion type serial question
@ 2008-03-14 15:17 Tom Lane <tgl@sss.pgh.pa.us>
parent: Carol Walter <walterc@indiana.edu>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2008-03-14 15:17 UTC (permalink / raw)
To: Carol Walter <walterc@indiana.edu>; +Cc: pgsql-admin
Carol Walter <walterc@indiana.edu> writes:
> Can I designate a column not
> previously defined as serial to serial.
"serial" is not really a type. It's just a convenience macro for
creating a sequence and setting the column's default expression.
So what you do is perform those steps manually. See
http://www.postgresql.org/docs/8.2/static/datatype-numeric.html#DATATYPE-SERIAL
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2008-03-14 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14 15:05 Database conversion type serial question Carol Walter <walterc@indiana.edu>
2008-03-14 15:17 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox