How to write a function that returns text or integer values?

前端 未结 3 997
名媛妹妹
名媛妹妹 2020-12-11 07:34

I\'m using PostgreSQL 9.2.4.

postgres=# select version();

                           version
--------------------------------------------------------         


        
3条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 08:25

    A function can only return one type. In your case, you could create a composite type with two fields, one integer and one text, and return that.

提交回复
热议问题