Re: Select default values

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Select default values
Дата
Msg-id 162867790807230319q2002719aq9ded4dc7b7f7cb24@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Select default values  (Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>)
Ответы Re: Select default values  (Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>)
Список pgsql-sql
2008/7/23 Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>:
> 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..

begin insert ...rollback;

it's not best solution, but it just works.

regards
Pavel
>
> Thanks a lot and best wishes from Berlin,
>
> Maximilian Tyrtania
>
>
>


В списке pgsql-sql по дате отправления:

Предыдущее
От: Maximilian Tyrtania
Дата:
Сообщение: Re: Select default values
Следующее
От: Maximilian Tyrtania
Дата:
Сообщение: Re: Select default values