X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 73E9C8B9F19 for ; Thu, 3 Feb 2005 20:20:23 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86497-10 for ; Thu, 3 Feb 2005 20:20:18 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 35BBB8B9F1C for ; Thu, 3 Feb 2005 20:20:18 +0000 (GMT) Received: (qmail invoked by alias); 03 Feb 2005 20:20:16 -0000 Received: from p54806112.dip0.t-ipconnect.de (EHLO hermes.hilbert.loc) (84.128.97.18) by mail.gmx.net (mp009) with SMTP; 03 Feb 2005 21:20:16 +0100 X-Authenticated: #1433807 Received: (from ncq@localhost) by hermes.hilbert.loc (8.11.6/8.11.6/SuSE Linux 0.5) id j13K4Ji05895 for pgsql-sql@postgresql.org; Thu, 3 Feb 2005 21:04:19 +0100 Date: Thu, 3 Feb 2005 21:04:18 +0100 From: Karsten Hilbert To: pgsql-sql@postgresql.org Subject: Re: Information about the command SQL " create synonym". Message-ID: <20050203210418.E612@hermes.hilbert.loc> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.22.1i X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/77 X-Sequence-Number: 20188 > Much like yourself, I have been searching for a way to create synonyms > in Postgres. I think that I have found a hack / solution to our > problem. ... > What I did, was to make use of the Postgres inheritance feature. > This in turn effectively creates an alias: > CREATE TABLE foo (bar int not null); > > but you need a synonym called "gerald", then you could do the following ... > > CREATE TABLE gerald () INHERITS (foo); > I would love to hear from the developers, or other gurus, if there are > any serious issues with doing this. Primary keys and foreign keys will likely show unexpected behaviour (as in being out of sync between foo and gerald and any other "alias" child tables of foo). Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346