set default: question

From: Marco Bomben <marco(dot)bomben(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: set default: question
Date: 2010-04-21 15:21:14
Message-ID: y2vfbc4c2201004210821qbeebaad9wd74e6b5af74972d1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Dear all,
I've started using postgresql this week and I found it awesome!
I've a problem in understanding the "SET DEFAULT" command.

fssr2db=# ALTER TABLE fssr2calibs ALTER COLUMN intvbn SET DEFAULT 139;
ALTER TABLE

but:
fssr2db=# SELECT tag, intvbn from fssr2calibs
WHERE tag = '100421-154052' OR tag = '100302-161107';
tag | intvbn
---------------+--------
100302-161107 | 139
100421-154052 |

and
fssr2db=# \d fssr2calibs
Table "public.fssr2calibs"
Column | Type | Modifiers
-----------------+-------------------------+---------------
tag | character varying(13) |
module | integer |
sidetype | polarity |
chipnum | numofchip |
pomonechipnum | pomonechip |
fssr2daqchipnum | fssr2daqchip |
tchip | real |
tpcb | real |
vmodule | real |
imodule | real |
peltierstatus | boolean |
vpeltier | real |
ipeltier | real |
nchips | real |
sensorstatus | bit(1)[] |
sensortype | character varying(120) |
shortdettype | shortdet |
vbias | real |
leakagecurr | real |
maskedchans | integer[] |
noise | real |
thrdisp | real[] |
disvtn | integer |
vth | integer[] |
vmin | integer |
vmax | integer |
vstep | integer |
comments | character varying(1000) |
fanon | integer |
n2flux | real |
troom | real |
intvbn | integer | default 139
shpvbp2 | integer |
shpvbp1 | integer |
blrvbp1 | integer |
shaping | integer |
highgain | boolean | default false
blr | boolean

So I do see the effects of SET DEFAULT on the table as a whole (through \d
<table name>)
but not on each row (I set the value for some of them and for some not
before using SET DEFAULT).

Is there any way to get the default value for each single row?
I'm using postgres 8.4.3.

Many thanks in advance,
regards,
Marco Bomben

--
"Human existence is based upon two pillars: Compassion and knowledge.
Compassion without knowledge is ineffective; knowledge without compassion is
inhuman."
(Victor Frederick Weisskopf)
----------------------------------------------
http://marco.bomben.googlepages.com/

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message jr 2010-04-22 08:51:04 Re: PostgreSQL Book
Previous Message Carel Combrink 2010-04-21 13:07:25 PostgreSQL Book