Re: nextval::text

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: gearond(at)cvc(dot)net
Cc: pgsql-general(at)postgresql(dot)org, John Smith <john_smith_45678(at)yahoo(dot)com>
Subject: Re: nextval::text
Date: 2003-03-07 17:24:31
Message-ID: 200303071724.h27HOVe27042@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Of course, a bigger question is why the ::text cast is needed at all.

---------------------------------------------------------------------------

Dennis Gearon wrote:
> Because that's the name of the sequence, not the value coming out of the sequence.
>
> 3/4/2003 10:54:34 PM, John Smith <john_smith_45678(at)yahoo(dot)com> wrote:
>
> >
> >
> > Date: Tue, 4 Mar 2003 22:54:34 -0800 (PST)
> >
> > From: John Smith <john_smith_45678(at)yahoo(dot)com>
> > Subject:[GENERAL] nextval::text
> > To: pgsql-general(at)postgresql(dot)org
> >
> >
> >
> >
> > I was just wondering why in the generated schema nextval is cast to text
> > rather than int?
> >
> >
> > John
> >
> > CREATE TABLE x (
> > id integer DEFAULT nextval('"x_id_seq"'::text) NOT NULL,
> > name character varying(30) NOT NULL
> > );
> >
> >
> >
> >
> >
> > Do you Yahoo!?
> > Yahoo! Tax Center - forms, calculators, tips, and more
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-03-07 17:40:33 Re: [HACKERS] problems with dropped columns
Previous Message Tom Lane 2003-03-07 17:23:53 Re: Unexpected parse behaviour for date to timestamp