[Pgsql-ayuda] columna NOT NULL
   
    Eladio Rodriguez
     
    elarod01@hotmail.com
       
    Wed, 30 Apr 2003 17:16:15 -0600
    
    
  
<html><div style='background-color:'><DIV>saludos. </DIV>
<DIV></DIV>erodriguez-#alter table t 
<DIV></DIV>erodriguez-#add contraint c_pk primary key (c); 
<DIV></DIV>ALTER 
<DIV></DIV>
<DIV></DIV>erodriguez-# add constraint c_pk primary key (c); 
<DIV></DIV>ERROR: Existing attribute "c" cannot be a PRIMARY KEY because it is not marked 
<DIV></DIV>NOT NULL 
<DIV></DIV>
<DIV> </DIV>
<DIV>y efectivamente la columna no esta marcada como NOT NULL, lo que tiene es un constraint</DIV>
<DIV> </DIV>
<DIV>erodriguez-# \d t<BR>                 Table "t"<BR> Column |         Type         | Modifiers<BR>--------+----------------------+-----------<BR> c      | character varying(1) |<BR>Check constraints: "c_not_null" NULL::bool</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>el comando SET LINESIZE 5000, lo que hace es que cuando el SELECT necesita presentar los datos mas alla del borde derecho se le puede dar scroll y no te salen las cosas como:</DIV>
<DIV> </DIV>
<DIV>erodriguez=# select * from fac_e;<BR> factura |   fecha    | cliente | vendedor | credito | subtotal |  iv  | descuen<BR>to | total<BR>---------+------------+---------+----------+---------+----------+------+--------<BR>---+-------<BR> 1       | 2003-04-30 | 1       |          |         |     0.00 | 0.00 |      0.<BR>00 |  0.00<BR>(1 row)</DIV>
<DIV> </DIV></div><br clear=all><hr>Protect your PC - <a href="http://g.msn.com/8HMSEN/2755">Click here</a> for McAfee.com VirusScan Online </html>