[Pgsql-ayuda] columna NOT NULL

From: "Eladio Rodriguez" <elarod01(at)hotmail(dot)com>
To: Pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
Subject: [Pgsql-ayuda] columna NOT NULL
Date: 2003-04-30 23:16:15
Message-ID: Law8-F56kyPzGNsokLQ0000d184@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

<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>&nbsp;</DIV>
<DIV>y efectivamente la columna no esta marcada como NOT NULL, lo que tiene es un constraint</DIV>
<DIV>&nbsp;</DIV>
<DIV>erodriguez-# \d t<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Table "t"<BR>&nbsp;Column |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Modifiers<BR>--------+----------------------+-----------<BR>&nbsp;c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | character varying(1) |<BR>Check constraints: "c_not_null" NULL::bool</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>erodriguez=# select * from fac_e;<BR>&nbsp;factura |&nbsp;&nbsp; fecha&nbsp;&nbsp;&nbsp; | cliente | vendedor | credito | subtotal |&nbsp; iv&nbsp; | descuen<BR>to | total<BR>---------+------------+---------+----------+---------+----------+------+--------<BR>---+-------<BR>&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2003-04-30 | 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 0.00 | 0.00 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.<BR>00 |&nbsp; 0.00<BR>(1 row)</DIV>
<DIV>&nbsp;</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>

Attachment Content-Type Size
unknown_filename text/html 1.9 KB

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Gunnar Wolf 2003-04-30 23:39:31 Re: [Pgsql-ayuda] columna NOT NULL
Previous Message Gunnar Wolf 2003-04-30 22:46:17 Re: [Pgsql-ayuda] columna NOT NULL