Re: Select default values - Mailing list pgsql-sql

From Giorgio Valoti
Subject Re: Select default values
Date
Msg-id F89CAE09-2812-48DF-B182-DC2893863361@mac.com
Whole thread Raw
In response to Re: Select default values  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Responses Re: Select default values  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
On 23/lug/08, at 11:28, Pavel Stehule wrote:

> Hello
>
> 2008/7/23 Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>:
>> 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" ?
>> Unfortunately this syntax doesn't seem to be supported. I know i
>> can select
>> the default values for each column, but being able to select them
>> in one go
>> would be handy...
>
>
> 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 *;

It seems that you can’t use the same syntax with function calls:
select function(default,default);
gives a syntax error. Is it expected?

--
Giorgio Valoti

pgsql-sql by date:

Previous
From: Maximilian Tyrtania
Date:
Subject: Cloning hierarchical data
Next
From: Richard Huxton
Date:
Subject: Re: Select default values