Skip site navigation (1) Skip section navigation (2)

Re: how to do prefix_range default value?

From: Tony Liao <tonyliao(at)yuehetone(dot)com>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to do prefix_range default value?
Date: 2009-04-08 09:06:00
Message-ID: 8f750b7c0904080206x1ef8d0aao969484e22e0c9097@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
Dimitri,        thank you.it works well.
                                                             yours,tony


2009/4/6 Dimitri Fontaine <dfontaine(at)hi-media(dot)com>

> Hi,
>
> On Friday 03 April 2009 05:03:37 Tony Liao wrote:
> >      now I want to insert default value [] to prefix column,because if
> the
> > prefix column is NULL,the returns are not I want (with prefix @>'text').I
> > alter column prefix default [],it return error:
> > ERROR:  syntax error at or near "["
> > LINE 2:    ALTER COLUMN prefix SET DEFAULT [];
>
> You need to have the value protected into quotes, as it's a literal:
>
> dim=# create table tl(a prefix_range default '[]');
> CREATE TABLE
> dim=# \d tl
>                 Table "public.tl"
>  Column |     Type     |         Modifiers
> --------+--------------+----------------------------
>  a      | prefix_range | default '[]'::prefix_range
>
>
> --
> dim
>

In response to

pgsql-admin by date

Next:From: Parks, Aaron B.Date: 2009-04-08 12:33:33
Subject: Re: PG 8.1, dump/restore not consistent for sequence names
Previous:From: Tom LaneDate: 2009-04-07 20:58:23
Subject: Re: PG 8.1, dump/restore not consistent for sequence names

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group