Hello

On 05/04/2008, Pedro Doria Meunier <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  Is it possible to have a table's column default value set to some form of
>  select?
>

directly no, but you can use function

postgres=# create table a(a integer);
CREATE TABLE

postgres=# create function mx() returns int as $$select max(a) from
a$$ language sql volatile;
CREATE FUNCTION
postgres=# create table b(x integer default mx());
CREATE TABLE

Regards
Pavel Stehule
>  e.g. picking another table's value for a given SELECT ... WHERE ...
>
>  Already thankful for any insight,
>
> --
>  Pedro Doria Meunier
>  Ips. da Olaria, Edf. Jardins do Garajau, 4, r/c Y
>  9125-162 Caniço
>  Madeira - Portugal
>  --------------------------------------------------
>  Skype : pdoriam
>  Mobile: +351961720188
>
>

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to