How to use the 'char() ' as data type and a function name in the same time.

From: rohtodeveloper <rohtodeveloper(at)outlook(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: How to use the 'char() ' as data type and a function name in the same time.
Date: 2014-06-23 12:58:36
Message-ID: BAY178-W32B407AA1F9A5DB0E237C2C41F0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Hackers
When I use the pg_catalog.char(integer) function in the postgres, I can only use it like these:select pg_catalog.char(65); select "char"(65);
But I want to use the function by the following way.select char(1);Of coures, There would be a gram error.
I know the error is caused by that the 'char()' has been defined as one of character data types in the 'src\backend\parser\gram.y' file.
However, In SQLServer, the 'char()' can be used as data type and a function name in the same time.
For example:---------------------------------------------------select char(65) ----> char() used as a function name----A
select cast('1' as char(4)); ----> char() used as data type------- 1 --------------------------------------------------------
So, I wonder if there is a solution in the postgreSQL to use the char() as data type and function name in the same time like in SQLServer.
==================================

Any help appreciated.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-06-23 13:04:34 Re: Use a signal to trigger a memory context dump?
Previous Message Stephen Frost 2014-06-23 12:50:33 Re: pgaudit - an auditing extension for PostgreSQL