Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-12 Thread Vinayak
Thank you for replay. >You will not be able to do it without modifying the grammar. SYNONYM >isn't even a keyword in stock PG. If I understood correctly since SYNONYM is not the part of the grammar, the parser throw a syntax error before reaching to hook. - Regards, Vinayak, -- View this

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-11 Thread Tom Lane
Vinayak writes: > Is it possible to parse the CREATE SYNONYM statement and convert into CREATE > VIEW statement using post_parse_analyze_hook? or is there any other idea to > automate this process? You will not be able to do it without modifying the grammar. SYNONYM isn't even a keyword in stock

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-11 Thread Vinayak
Hello, >There are pros and cons to this approach. In general, I'd recommend >using a simple view instead of trying to use the search_path- for >example, prepared queries will look up the OID based on the current >search_path. If you prepare a query, then change your search_path, and >run tha

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-10 Thread Tom Lane
Stephen Frost writes: > In general, this has been discussed a number of times in the past (I > brought it up when I ran into the issue originally too..) and I continue > to feel that it'd be good for us to have, but the argument is that > anything done to support synonyms would necessairly slow do

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-10 Thread Stephen Frost
Vinayak, * Vinayak (vinpok...@gmail.com) wrote: > We are converting the Oracle's CREATE SYNONYM statement into PostgreSQL. Ah, I remember having to deal with exactly that issue when migrating from Oracle. > I think to replace the SYNONYM we use search_path in PostgreSQL and the same > thing is

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-10 Thread Joshua D. Drake
On 09/10/2014 06:50 AM, Vinayak wrote: Hello, We are converting the Oracle's CREATE SYNONYM statement into PostgreSQL. I think to replace the SYNONYM we use search_path in PostgreSQL and the same thing is explained in the below post also. http://postgresql.1045698.n5.nabble.com/Synonyms-in-Post

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-10 Thread Jerry Sievers
Vinayak writes: > Hello, > We are converting the Oracle's CREATE SYNONYM statement into PostgreSQL. > I think to replace the SYNONYM we use search_path in PostgreSQL and the same > thing is explained in the below post also. > http://postgresql.1045698.n5.nabble.com/Synonyms-in-PostgreSQL-9-2-4-t

Re: [GENERAL] CREATE SYNONYM in PostgreSQL

2014-09-10 Thread Albe Laurenz
Vinayak wrote: > We are converting the Oracle's CREATE SYNONYM statement into PostgreSQL. > I think to replace the SYNONYM we use search_path in PostgreSQL and the same > thing is explained in the below post also. > http://postgresql.1045698.n5.nabble.com/Synonyms-in-PostgreSQL-9-2-4-td5757986.html