public inbox for [email protected]  
help / color / mirror / Atom feed
incorrect data type in function
2+ messages / 2 participants
[nested] [flat]

* incorrect data type in function
@ 2016-05-21 14:00 [email protected]
  2016-05-24 17:35 ` Re: incorrect data type in function Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: [email protected] @ 2016-05-21 14:00 UTC (permalink / raw)
  To: pgsql-docs

The following documentation comment has been logged on the website:

Page: http://www.postgresql.org/docs/8.2/static/plpgsql-porting.html
Description:

on page :

http://www.postgresql.org/docs/current/static/plpgsql-porting.html

under 40.12.1. Porting Examples -&gt; Example 40-8. Porting a Simple Function
from PL/SQL to PL/pgSQL
======================================
CREATE OR REPLACE FUNCTION cs_fmt_browser_version(v_name varchar,
                                                  v_version varchar)
RETURN varchar IS
BEGIN
    IF v_version IS NULL THEN
        RETURN v_name;
    END IF;
    RETURN v_name || &#39;/&#39; || v_version;
END;
/
show errors;
======================================


The data types in the function parameter and the returned type were seems
typed incorrectly or missed typo ... in ORACLE there is no varchar, but
there is varchar2

And since I AM away from ORACLE for more than decade, I might be wrong.

Appreciate your efforts in keeping the best as open source.

Thanks,


-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: incorrect data type in function
  2016-05-21 14:00 incorrect data type in function [email protected]
@ 2016-05-24 17:35 ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2016-05-24 17:35 UTC (permalink / raw)
  To: [email protected]; +Cc: pgsql-docs

[email protected] writes:
> The data types in the function parameter and the returned type were seems
> typed incorrectly or missed typo ... in ORACLE there is no varchar, but
> there is varchar2

According to what I can find on the web, Oracle treats varchar and
varchar2 as interchangeable type names, but they say they might someday
fix varchar to be spec-compliant about distinguishing null from empty
strings.  (I'll believe that when I see it...)

So our examples are not wrong, but nonetheless this is a good suggestion
because changing them creates an opportunity to talk about the general
porting problem of needing to translate Oracle type names to Postgres.
I've pushed a patch based on that:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=23f11dc21b0135702a2852aac927bdc4f9...

Thanks for the suggestion!

			regards, tom lane


-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-05-24 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-21 14:00 incorrect data type in function [email protected]
2016-05-24 17:35 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox