Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2015
    Posts
    1

    Unanswered: create table function

    When i create a function with upper case letters, it always creates function with lower case, is this designed in postgres like this or how else do i create case insensitive functions in postgres? I tried giving the name inside double quotes, it didn't help much.


    statement used to create function

    create or replace function oe.TF_ZAGleFF (_tableName text, _table_name text)
    CREATE FUNCTION

    Actual function created

    oe | tf_zagleff | SETOF record | _tablename text, _table_name text

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by neosujoy View Post
    When i create a function with upper case letters, it always creates function with lower case, is this designed in postgres like this
    Yes this is by design and well documented:

    http://www.postgresql.org/docs/curre...AX-IDENTIFIERS

    or how else do i create case insensitive functions in postgres?
    An unquoted identifier is case insensitive:
    Code:
    psql (9.4.4)
    Type "help" for help.
    
    postgres=> create function foo() returns integer as $$select 42;$$ language sql;
    CREATE FUNCTION
    
    postgres=> select FOO();
     foo
    -----
      42
    (1 row)
    
    postgres=> select Foo();
     foo
    -----
      42
    (1 row)
    
    postgres=> select fOo();
     foo
    -----
      42
    (1 row)
    
    postgres=>
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •