Re: Repetitive fields

From: Scott Bailey <artacus(at)comcast(dot)net>
To: ekekakos <ekekakos(at)hol(dot)gr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Repetitive fields
Date: 2009-09-18 20:25:13
Message-ID: 4AB3ECA9.8090500@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ekekakos wrote:
> Hello, I would like to create with several tables but each table will have 2
> fields, LASTUSERID & LASTUPDATEDATETIME. My quest is:
> Is there any way to create these 2 fields and then use them in all tables?
>
> Please help the soonest table.
> Thanks in advance
> Elias

No. Perhaps you were thinking you could create a table w/ these two
columns and then alter your other tables to inherit that table. But I
don't think that's a great idea and those columns already have to exist
in the child tables in order to be able to alter the inheritance.

You'll have to add the columns manually. You should be able to write a
function in a few minutes that walks a cursor and adds them to each
table in a given schema.

Scott Bailey

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2009-09-18 20:39:43 Re: NAS
Previous Message Merlin Moncure 2009-09-18 19:16:05 Re: NAS