pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedWhich ODBC ?
2+ messages / 2 participants
[nested] [flat]
* Which ODBC ?
@ 2001-11-12 09:46 Fabio Serra <faser@faser.net>
0 siblings, 0 replies; 2+ messages in thread
From: Fabio Serra @ 2001-11-12 09:46 UTC (permalink / raw)
To: pgsql-admin
Hi everybody,
I'm using PostgreSQL unixODBC with Macromedia ColdFusion 5.
With newer unixodbc driver I can't select text longer than 8K. I'm not a C
programmer, but the source code, defines TEXT_FIELD_SIZE 8190 and mallocs
up to this 8190 +5, even if now postgres supports dynamically growing text
fields.
I noticed another wrong behaviour. The driver does't escape special chars
correctly.
The following combination produce an error: \'
I would like to know if the odbc driver included in PG 7.1.3 is affected
from the same "bug" and if there are substantial differents
Thanks in advance.
--------------------------------------------------
FABIO SERRA - faser(at)faser.net
PGP available
--------------------------------------------------
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Which ODBC ?
@ 2001-11-12 16:29 jcmd@acer.com.mx <jcmd@acer.com.mx>
0 siblings, 0 replies; 2+ messages in thread
From: jcmd@acer.com.mx @ 2001-11-12 16:29 UTC (permalink / raw)
To: Fabio Serra <faser@faser.net>; +Cc: pgsql-admin
like this...
create table article(
id_article serial,
article text not null,
num_of_part_of_article int not null
);
i use this script in perl, :) very, very pig
use CGI qw/:standard/;
use DBI;
use File::Find();
my ($graba, $handDb, $archivo, $contenido, $sth, $query, $name);
$graba = undef;
$handDb = DBI->connect("dbi:Pg:dbname=XhoxXohaxX","Pi%fazes","Ley@sa") ||
die
"I cannot open the web_acer database";
@ARGV = qw (/var/www/html/acer/sp/)unless @ARGV;
sub find(&@){
&File::Find::find;
}
sub ver(){
$archivo = shift @_;
open(FILE,"<$archivo") || die "I can't open >> $archivo <<";
$contenido = ''; $parte = 20;
while (<FILE>) {
next if /^\n/;
if(/THIS IS THE TABLE HOLDING THE MAIN CONTENT OF ALL THE/g){
$graba=1;
next;
}
if(/AND THIS IS WHERE THE MAIN CONTENT TABLE ENDS/g){
$graba=undef;
last;
}
s/\'/\\'/g;
s/\"/\\"/g; #'
s/^\s//g;
# s/ +\s$//g;
# s/\t+//g;
if (defined $graba){
if(length $contenido < 7000){
$contenido.=$_;
}else{
$parte--;
$archivo =~ s%/var/www/html/acer%%;
$query = "insert into pages(path,content,partes) values
('$archivo','$contenido','$parte')";
$sth = $handDb->prepare("$query") || die "No pude preparar
la consulta: $DBI::errstr";
$sth->execute || die "No pude ejecutar la consulta:
$DBI::errstr";
$contenido = '';
}
}
}
$parte--;
$archivo =~s%/var/www/html/acer/%%;
$query = "insert into pages(path,content,partes) values
('$archivo','$contenido','$parte')";
$sth = $handDb->prepare("$query") || die "No pude preparar la
consulta: $DBI::errstr";
$sth->execute || die "No pude ejecutar la consulta: $DBI::errstr";
print "$archivo\n";
}
In this script i looking for all .html files in a directory ( recursive )
and the content of that files, I cut the content of each file, in 7Kb for
row, and save the order whit the field "partes" with a Max of 20. :)
Very very pig.
Regards!
On Mon, 12 Nov 2001, Fabio Serra wrote:
{At 16.12 12/11/2001, you wrote:
{
{
{>This behaviour, not its for th ODBC, the instalation of PG becomes with
{>that definition of TEXT_FIELD_SIZE, to repair this "ploblem" just compile
{>the PG with the Option TEXT_FILE_SIZE with more K.
{
{Yes, I can try to recompile PG, but now I have no problems to insert and
{select long text directly from the database.
{The problem arise only using unixODBC.
{What do you mean saying "Defines, more TEXT fields, for the same data. :) " ?
{Ex:
{
{create table article (
{article text not null,
{article text not null,
{);
{
{?!??
{Bye.
{
{--------------------------------------------------
{FABIO SERRA - faser(at)faser.net
{PGP available
{--------------------------------------------------
{
{
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-11-12 16:29 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-12 09:46 Which ODBC ? Fabio Serra <faser@faser.net>
2001-11-12 16:29 Re: Which ODBC ? jcmd@acer.com.mx <jcmd@acer.com.mx>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox