Re: DB_DataObject PogreSQL Sequence
| From: | Justin Patrin | Date: | Thu, 30 Dec 2004 20:06:50 +0000 |
| Subject: | Re: DB_DataObject PogreSQL Sequence | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16524@lists.php.net to get a copy of this message | ||
On Wed, 29 Dec 2004 12:07:41 +0800, Muhyiddin A.M Hayat
<middink@indo.net.id> wrote:
> Dear all
>
> I have problem with Sequence on PostgreSQL.
>
> I have created below table:
>
> CREATE TABLE "public"."news" (
> "id" SERIAL,
> "title" VARCHAR(64) NOT NULL,
> "intro_text" TEXT,
> "full_text" TEXT,
> "picture" BYTEA,
> "created" TIMESTAMP(0) WITH TIME ZONE DEFAULT ('now'::text)::timestamp(6)
> with time zone,
> "created_by" INTEGER,
> "publish_up" TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT
> ('now'::text)::timestamp(6) with time zone,
> "publish_down" TIMESTAMP(0) WITHOUT TIME ZONE,
> CONSTRAINT "news_pkey" PRIMARY KEY("id")
> ) WITH OIDS;
>
> Table "public.news"
> Column | Type | Modifiers
>
> --------------+--------------------------------+------------------------------------------------------
> id | integer | not null default
> nextval('public.news_id_seq'::text)
> title | character varying(64) | not null
> intro_text | text |
> full_text | text |
> picture | bytea |
> created | timestamp(0) with time zone | default ('now'::text)::timestam
> p(6) with time zone
> created_by | integer |
> publish_up | timestamp(0) without time zone | default ('now'::text)::timestamp(6)
> with time zone
> publish_down | timestamp(0) without time zone |
> Indexes: news_pkey primary key btree (id)
>
> the Sequence created is news_id_seq. when i using DB_DataObject, DB_DataObject doen't
> use news_id_seq, but DB_DataObject created news_seq and using them.
>
> How to swich to default Sequence (news_id_seq)
>
Try $do->sequenceKey('id');
--
Justin Patrin