Peter, is there a way from pgsql to show if an index is unique?  It
would be nice.

	test=# create table x(y int);
	CREATE
	test=# create unique index xx on x(y);
	CREATE
	test=# \d xx
	       Table "xx"
	 Attribute | Type | Info 
	-----------+------+------
	 y         | int4 | 

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 26 Nov 1999 12:46:36 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [PATCHES] A bag of psql goodiesu
On 1999-11-26, Bruce Momjian mentioned:

> Peter, is there a way from pgsql to show if an index is unique?  It
> would be nice.

Works here:
(I think this was part of the last patch.)

play=> \d baaz
        Table "baaz"
 Attribute | Type |  Extra   
-----------+------+----------
 a         | int4 | not null
Index: baaz_pkey
Rule: baaz_rule

play=> \d baaz_pkey
Index "baaz_pkey"
 Attribute | Type 
-----------+------
 a         | int4
unique btree (primary key)

play=> \d bar      
       Table "bar"
 Attribute | Type | Extra 
-----------+------+-------
 a         | int4 | 
 b         | text | 
Indices: barindex,
         barunique
Constraints: a > 0
             b IN ( 'yes' , 'no' )

play=> \d barindex
Index "barindex"
 Attribute | Type 
-----------+------
 a         | int4
btree

play=> \d barunique
Index "barunique"
 Attribute | Type 
-----------+------
 a         | int4
 b         | text
unique btree

-- 
Peter Eisentraut                  Sernanders vï¿½g 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



Sun, 28 Nov 1999 16:14:19 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: [HACKERS] Re: [PATCHES] A bag of psql goodies

Thanks.  I see it now.


[Charset ISO-8859-1 unsupported, filtering to ASCII...]
> On 1999-11-26, Bruce Momjian mentioned:
> 
> > Peter, is there a way from pgsql to show if an index is unique?  It
> > would be nice.
> 
> Works here:
> (I think this was part of the last patch.)
> 
> play=> \d baaz
>         Table "baaz"
>  Attribute | Type |  Extra   
> -----------+------+----------
>  a         | int4 | not null
> Index: baaz_pkey
> Rule: baaz_rule
> 
> play=> \d baaz_pkey
> Index "baaz_pkey"
>  Attribute | Type 
> -----------+------
>  a         | int4
> unique btree (primary key)
> 
> play=> \d bar      
>        Table "bar"
>  Attribute | Type | Extra 
> -----------+------+-------
>  a         | int4 | 
>  b         | text | 
> Indices: barindex,
>          barunique
> Constraints: a > 0
>              b IN ( 'yes' , 'no' )
> 
> play=> \d barindex
> Index "barindex"
>  Attribute | Type 
> -----------+------
>  a         | int4
> btree
> 
> play=> \d barunique
> Index "barunique"
>  Attribute | Type 
> -----------+------
>  a         | int4
>  b         | text
> unique btree
> 
> -- 
> Peter Eisentraut                  Sernanders v_g 10:115
> peter_e@gmx.net                   75262 Uppsala
> http://yi.org/peter-e/            Sweden
> 
> 
> 
> ************
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Mon, 29 Nov 1999 22:28:45 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Re: [PATCHES] A bag of psql goodies