Code: Select all
CREATE TABLE tSomething(ID SERIAL, col1 type, col2 type...);If anyone has any suggestions for ways to get the name of the serial column's sequence, or has a more elegant way of retrieving the value without using an actual query (perhaps a pg_* function I'm not aware of), I'd very much appreciate it.
I'm using PostgreSQL 7.1.4.
Edit: I ran across the following information on the PHP.net page for the pg_last_notice function.
Code: Select all
$res = pg_query("CREATE TABLE test (id SERIAL)");
$notice = pg_last_notice($pgsql_conn);
echo $notice;Code: Select all
CREATE TABLE will create implicit sequence "test_id_seq" for "serial" column "test.id"