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

Re: Triggers and Domains

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ekekakos <ekekakos(at)hol(dot)gr>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Triggers and Domains
Date: 2009-08-30 17:01:37
Message-ID: 16416.1251651697@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
ekekakos <ekekakos(at)hol(dot)gr> writes:
> Thanks but how, in SQL server you put the function USER() (if I remember
> well) and it works.
> Here it does not work.

Define "does not work", please?

regression=# create domain username as text default user;  
CREATE DOMAIN
regression=# create table foo(f1 int, lastupdateuser username);
CREATE TABLE
regression=# insert into foo(f1) values(42);
INSERT 0 1
regression=# select * from foo;
 f1 | lastupdateuser 
----+----------------
 42 | postgres
(1 row)


			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: ekekakosDate: 2009-08-30 18:25:47
Subject: Re: Triggers and Domains
Previous:From: ekekakosDate: 2009-08-30 16:32:22
Subject: Re: Triggers and Domains

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