| From: | Maximilian Tyrtania <maximilian(dot)tyrtania(at)onlinehome(dot)de> |
|---|---|
| To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
| Cc: | <pgsql-sql(at)postgresql(dot)org> |
| Subject: | Re: Select default values |
| Date: | 2008-07-23 09:49:25 |
| Message-ID: | C4ACCB45.302C0%maximilian.tyrtania@onlinehome.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Hi again,
>> Hi there, just a quickie: Is there a way to select all default values of a
>> given table? Something like "Select Default values from sometable" ?
> it's not possible directly, you can find expressions used as default
> in system tables or
> postgres=# create table f(a integer default 1, b integer);
> CREATE TABLE
> postgres=# insert into f(a,b) values(default, default) returning *;
> a | b
> ---+---
> 1 |
> (1 row)
>
> INSERT 0 1
> regards
> Pavel Stehule
ah, I see, smart, the problem with this is just that I don't actually want
to insert the record just yet. I just want to hand the default values over
to my app. Well, of course my app could still delete the record later on,
but still that seems cumbersome..
Thanks a lot and best wishes from Berlin,
Maximilian Tyrtania
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Maximilian Tyrtania | 2008-07-23 09:57:08 | Re: Select default values |
| Previous Message | Pavel Stehule | 2008-07-23 09:28:54 | Re: Select default values |