JeyJ
JeyJ

Reputation: 4070

Postgresql 9.6 functions argument casting int to string

I have a function in my postgresql database that get as an argument text : func1 (arg1 text);

I summon it many times somethimes with strings as arguments and some times as interger. I know that in oracle we can send int as an argument to a function that get string argument. Is it possible in postgresql ? I must use casting ?

Upvotes: 0

Views: 638

Answers (1)

Erich Kitzmueller
Erich Kitzmueller

Reputation: 36987

In PostgreSQL, you do not have the same automatic casting like you have in Oracle. Instead, you have to cast explicitely:

select func1(134::text);

Upvotes: 2

Related Questions