Skip site navigation (1) Skip section navigation (2)

Re: Select default values

From: Giorgio Valoti <giorgio_v(at)mac(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Select default values
Date: 2008-07-24 10:30:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On 23/lug/08, at 11:28, Pavel Stehule wrote:

> Hello
> 2008/7/23 Maximilian Tyrtania <maximilian(dot)tyrtania(at)onlinehome(dot)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);
> 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

In response to


pgsql-sql by date

Next:From: Richard HuxtonDate: 2008-07-24 10:42:54
Subject: Re: Select default values
Previous:From: Maximilian TyrtaniaDate: 2008-07-24 07:43:07
Subject: Cloning hierarchical data

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group