pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Not Null Field
4+ messages / 3 participants
[nested] [flat]

* Not Null Field
@ 1999-09-20 15:34  Margarita Barvinok <brita@umich.edu>
  0 siblings, 2 replies; 4+ messages in thread

From: Margarita Barvinok @ 1999-09-20 15:34 UTC (permalink / raw)
  To: pgsql-interfaces


Hi,

I created the phonebook table with NOT NULL fileds:

create table phonebook (
first varchar(20) NOT NULL,
last varchar(20) NOT NULL,
uniqname char(8) NOT NULL PRIMARY KEY,
phone varchar(30),
status char(7) NOT NULL,
room varchar(40) );

If I try to insert NULL values into those fields from psql I got an error
message - that is right.
But when I insert records from my C-program (with embedded SQL) I dot no
errors and such records are added to the table. I even can insert empty
record. Why this happens? Do I need to write some code to check NULL
values?

Thank you,
-Margarita


 
-------------------------------
Margarita Barvinok
System Administrator II
University of Michigan
Department of Biology
-------------------------------




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] Not Null Field
@ 1999-09-20 16:46  Michael Meskes <meskes@postgresql.org>
  parent: Margarita Barvinok <brita@umich.edu>
  1 sibling, 0 replies; 4+ messages in thread

From: Michael Meskes @ 1999-09-20 16:46 UTC (permalink / raw)
  To: Margarita Barvinok <brita@umich.edu>; +Cc: pgsql-interfaces

On Mon, Sep 20, 1999 at 11:34:42AM -0400, Margarita Barvinok wrote:
> But when I insert records from my C-program (with embedded SQL) I dot no

How do you do that?

> errors and such records are added to the table. I even can insert empty
> record. Why this happens? Do I need to write some code to check NULL
> values?

You shouldn't. Would you please send us a piece of source code?

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] Not Null Field
@ 1999-09-20 17:04  Ivo Simicevic <ivo@ultra.hr>
  parent: Margarita Barvinok <brita@umich.edu>
  1 sibling, 1 reply; 4+ messages in thread

From: Ivo Simicevic @ 1999-09-20 17:04 UTC (permalink / raw)
  To: Margarita Barvinok <brita@umich.edu>; +Cc: pgsql-interfaces

On Mon, Sep 20, 1999 at 11:34:42AM -0400, Margarita Barvinok wrote:
> 
> Hi,
> 
> I created the phonebook table with NOT NULL fileds:
> 
> create table phonebook (
> first varchar(20) NOT NULL,
> last varchar(20) NOT NULL,
> uniqname char(8) NOT NULL PRIMARY KEY,
> phone varchar(30),
> status char(7) NOT NULL,
> room varchar(40) );
> 
> If I try to insert NULL values into those fields from psql I got an error
> message - that is right.
> But when I insert records from my C-program (with embedded SQL) I dot no
> errors and such records are added to the table. I even can insert empty
> record. Why this happens? Do I need to write some code to check NULL
> values?
> 
> Thank you,
> -Margarita

How are you doing it? Can you send your source?
I guess you are not entering NULL but empty string values.

Ivo.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] Not Null Field
@ 1999-09-22 13:22  Margarita Barvinok <brita@umich.edu>
  parent: Ivo Simicevic <ivo@ultra.hr>
  0 siblings, 0 replies; 4+ messages in thread

From: Margarita Barvinok @ 1999-09-22 13:22 UTC (permalink / raw)
  To: Ivo Simicevic <ivo@ultra.hr>; +Cc: Michael Meskes <meskes@postgresql.org>; pgsql-interfaces


Ivo, I think you are right. I inserted empty strings.
Thank you for reply.

-Margarita

On Mon, 20 Sep 1999, Ivo Simicevic wrote:

> On Mon, Sep 20, 1999 at 11:34:42AM -0400, Margarita Barvinok wrote:
> > If I try to insert NULL values into those fields from psql I got an error
> > message - that is right.
> > But when I insert records from my C-program (with embedded SQL) I dot no
> > errors and such records are added to the table. I even can insert empty
> > record. Why this happens? Do I need to write some code to check NULL
> > values?
> > 
> > Thank you,
> > -Margarita
> 
> How are you doing it? Can you send your source?
> I guess you are not entering NULL but empty string values.
> 
> Ivo.
> 





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~1999-09-22 13:22 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-09-20 15:34 Not Null Field Margarita Barvinok <brita@umich.edu>
1999-09-20 16:46 ` Michael Meskes <meskes@postgresql.org>
1999-09-20 17:04 ` Ivo Simicevic <ivo@ultra.hr>
1999-09-22 13:22   ` Margarita Barvinok <brita@umich.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox