pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedwhat is the difference between default 0 vs default '0'
3+ messages / 3 participants
[nested] [flat]
* what is the difference between default 0 vs default '0'
@ 2002-06-26 00:52 Beth Gatewood <beth@vizxlabs.com>
0 siblings, 2 replies; 3+ messages in thread
From: Beth Gatewood @ 2002-06-26 00:52 UTC (permalink / raw)
To: pgsql-sql
all-
Could somebody tell me why I would use default 0 vs default '0' in the
following....
CREATE TABLE foo (col1 INTEGER default 0) <-- or default '0'
Thanks-
Beth
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: what is the difference between default 0 vs default '0'
@ 2002-06-26 02:35 Lee Harr <missive@frontiernet.net>
parent: Beth Gatewood <beth@vizxlabs.com>
1 sibling, 0 replies; 3+ messages in thread
From: Lee Harr @ 2002-06-26 02:35 UTC (permalink / raw)
To: pgsql-sql
In article <000c01c21cab$c2f35ef0$6901a8c0@bethvizx>, "Beth Gatewood" wrote:
> all-
> Could somebody tell me why I would use default 0 vs default '0' in the
> following....
> CREATE TABLE foo (col1 INTEGER default 0) <-- or default '0'
>
0 is an integer
'0' is a string
default '0' might work (through type coercion)
but I think default 0 is more clear.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: what is the difference between default 0 vs default '0'
@ 2002-06-26 06:46 Christopher Kings-Lynne <chriskl@familyhealth.com.au>
parent: Beth Gatewood <beth@vizxlabs.com>
1 sibling, 0 replies; 3+ messages in thread
From: Christopher Kings-Lynne @ 2002-06-26 06:46 UTC (permalink / raw)
To: Beth Gatewood <beth@vizxlabs.com>; pgsql-sql
Hi Beth,
I wouldn't have thought there'd be any difference to you, the user.
If you used 0, then that is an integer and that will be the default. If you
used '0' then that is a character or string and it will automatically be
cast into an integer when used as a default.
Chris
----- Original Message -----
From: "Beth Gatewood" <beth@vizxlabs.com>
To: <pgsql-sql@postgresql.org>
Sent: Wednesday, June 26, 2002 8:52 AM
Subject: [SQL] what is the difference between default 0 vs default '0'
> all-
> Could somebody tell me why I would use default 0 vs default '0' in the
> following....
> CREATE TABLE foo (col1 INTEGER default 0) <-- or default '0'
>
> Thanks-
> Beth
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-06-26 06:46 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-06-26 00:52 what is the difference between default 0 vs default '0' Beth Gatewood <beth@vizxlabs.com>
2002-06-26 02:35 ` Lee Harr <missive@frontiernet.net>
2002-06-26 06:46 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
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