Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j988z-0005MK-1N for pgsql-general@arkaria.postgresql.org; Tue, 03 Mar 2020 14:03:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j987z-0001qv-PS for pgsql-general@arkaria.postgresql.org; Tue, 03 Mar 2020 14:02:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j987z-0001qo-FK for pgsql-general@lists.postgresql.org; Tue, 03 Mar 2020 14:02:31 +0000 Received: from smh-06.1blu.de ([178.254.0.206]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j987w-00020a-I2 for pgsql-general@lists.postgresql.org; Tue, 03 Mar 2020 14:02:31 +0000 Received: from [172.16.29.5] (helo=sh4-5.1blu.de) by smh-06.1blu.de with esmtp (Exim 4.86_2) (envelope-from ) id 1j987t-0004Mj-WF; Tue, 03 Mar 2020 15:02:26 +0100 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.90_1) (envelope-from ) id 1j987t-0008NB-UK; Tue, 03 Mar 2020 15:02:25 +0100 Date: Tue, 3 Mar 2020 15:02:25 +0100 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: Perl::DBI and TYPE of column Message-ID: <20200303140225.GA26410@sh4-5.1blu.de> Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, We unload Sybase and Oracle data to migrate the database to PostgreSQL. The loading is done very fast with PostgreSQL's COPY command. During unload trailing blanks in all columns are discarded, because they would cause problems during loading for INT and DATE columns. The discarding is done like this after fetching the row into the array @row_ary: ... # SRP-25024: support for PostgreSQL: we remove on export trailing blanks foreach my $i (0..$#row_ary) { $row_ary[$i] =~ s/\s+$//; # but for CHAR columns we keep one # print $dba->{'sth'}->{NAME}->[$i] . " " . $dba->{'sth'}->{TYPE}->[$i] . "\n"; # it seems that VARCHAR in Sybase is TYPE=1 and in Oracle TYPE=12 # see also http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36273.1570/html/sprocs/CIHHGDBC.htm # and ftp://sqlstandards.org/SC32/SQL_Registry/ # if ($dba->{'sth'}->{TYPE}->[$i] == 1 || $dba->{'sth'}->{TYPE}->[$i] == 12) { $row_ary[$i] =~ s/^$/ /; } } My question here is: How I could get a copy of the document ftp://sqlstandards.org/SC32/SQL_Registry/ Any copy available here in this list? Thanks matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub