[fpc-pascal] pqconnection patch

Joost van der Sluis joost at cnoc.nl
Thu May 29 11:07:39 CEST 2008


Op woensdag 28-05-2008 om 13:52 uur [tijdzone -0300], schreef Joao
Morais:

> The following patch fixes the reading of a bytea field from a PgSQL 
> database.

Thanks, applied.

> Btw is there someone working on pg's blob storage?

I don't know anything about pg's blob storage, except for the separate
functions to store and read blob-fields, given an OID. Problem with that
approach is that you can't tell if a field contains a blob or not.
Because the field doesn't contain a blob but a reference to a blob. How
can you detect that this a field in fact is such a reference?

So the only way to use pg's blob's is to let the programmer store the
blob's. But it would be usefull if we build a wrapper around this, yes.

Joost.

> Joao Morais
> platte tekst document bijlage (pgconnection.pp.patch)
> Index: packages/fcl-db/src/sqldb/postgres/pqconnection.pp
> ===================================================================
> --- packages/fcl-db/src/sqldb/postgres/pqconnection.pp	(revision 11085)
> +++ packages/fcl-db/src/sqldb/postgres/pqconnection.pp	(working copy)
> @@ -103,6 +103,7 @@
>    SErrPrepareFailed = 'Preparation of query failed.';
>  
>  const Oid_Bool     = 16;
> +      Oid_Bytea    = 17;
>        Oid_Text     = 25;
>        Oid_Oid      = 26;
>        Oid_Name     = 19;
> @@ -395,6 +396,7 @@
>                               end;
>  //    Oid_text               : Result := ftstring;
>      Oid_text               : Result := ftBlob;
> +    Oid_Bytea              : Result := ftBlob;
>      Oid_oid                : Result := ftInteger;
>      Oid_int8               : Result := ftLargeInt;
>      Oid_int4               : Result := ftInteger;
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
-- 




More information about the fpc-pascal mailing list