Perl::DBI and TYPE of column

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Perl::DBI and TYPE of column
Date: 2020-03-03 14:02:25
Message-ID: 20200303140225.GA26410@sh4-5.1blu.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-03-03 14:36:32 Re: Perl::DBI and TYPE of column
Previous Message Nick Renders 2020-03-03 11:06:39 Postgres on macOS 10