Unix Technical Forum

synonym

This is a discussion on synonym within the pgsql Admins forums, part of the PostgreSQL category; --> Hi, Is it possible to create synonym in postgresql? I am getting error while creating synonym. ERROR: syntax error ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:17 AM
DBA
 
Posts: n/a
Default synonym

Hi,

Is it possible to create synonym in postgresql?

I am getting error while creating synonym.

ERROR: syntax error at or near "synonym" at character 8



Thanks & Regards,
Suresh



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:17 AM
Medi Montaseri
 
Posts: n/a
Default Re: synonym

PostgreSQL does not support SYNOSYM or ALIAS. Synonym is a non SQL 2003
feature implemented by Microsoft SQL 2005 (I think). While it does provide
an interesting abstraction, but due to lack of relational integrity, it can
be considered a risk.

That is, you can create a synonym, advertise it to you programmers, the code
is written around it, including stored procedures, then one day the backend
of this synonym (or link or pointer) is changed/deleted/etc leading to a run
time error. I don't even think a prepare would catch that.

It is the same trap as the symbolic links in unix and null pointers in
C/C++.

Cheers
Medi

On Dec 13, 2007 10:39 PM, DBA <s.borse@direction.biz> wrote:

> Hi,
>
> Is it possible to create synonym in postgresql?
>
> I am getting error while creating synonym.
>
> ERROR: syntax error at or near "synonym" at character 8
>
>
>
> Thanks & Regards,
> Suresh
>
>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:17 AM
Bruce Momjian
 
Posts: n/a
Default Re: synonym

Medi Montaseri wrote:
> PostgreSQL does not support SYNOSYM or ALIAS. Synonym is a non SQL 2003
> feature implemented by Microsoft SQL 2005 (I think). While it does provide
> an interesting abstraction, but due to lack of relational integrity, it can
> be considered a risk.
>
> That is, you can create a synonym, advertise it to you programmers, the code
> is written around it, including stored procedures, then one day the backend
> of this synonym (or link or pointer) is changed/deleted/etc leading to a run
> time error. I don't even think a prepare would catch that.
>
> It is the same trap as the symbolic links in unix and null pointers in
> C/C++.


It is on the TODO:

* Add support for public SYNONYMs

http://archives.postgresql.org/pgsql...3/msg00519.php

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:07 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com