|
-
lo_create(loid oid, string bytea)
+
lo_from_bytea(loid oid, string bytea)
oid
Create a large object and store data there, returning its OID.
Pass 0> to have the system choose an OID.
- lo_create(0, E'\\xffffff00')
+ lo_from_bytea(0, E'\\xffffff00')
24528
}
/*
- * Create LO with initial contents
+ * Create LO with initial contents given by a bytea argument
*/
Datum
-lo_create_bytea(PG_FUNCTION_ARGS)
+lo_from_bytea(PG_FUNCTION_ARGS)
{
Oid loOid = PG_GETARG_OID(0);
bytea *str = PG_GETARG_BYTEA_PP(1);
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201406051
+#define CATALOG_VERSION_NO 201406121
#endif
DATA(insert OID = 3172 ( lo_truncate64 PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 23 "23 20" _null_ _null_ _null_ _null_ lo_truncate64 _null_ _null_ _null_ ));
DESCR("truncate large object (64 bit)");
-DATA(insert OID = 3457 ( lo_create PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 26 "26 17" _null_ _null_ _null_ _null_ lo_create_bytea _null_ _null_ _null_ ));
-DESCR("create new large object with content");
+DATA(insert OID = 3457 ( lo_from_bytea PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 26 "26 17" _null_ _null_ _null_ _null_ lo_from_bytea _null_ _null_ _null_ ));
+DESCR("create new large object with given content");
DATA(insert OID = 3458 ( lo_get PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 17 "26" _null_ _null_ _null_ _null_ lo_get _null_ _null_ _null_ ));
DESCR("read entire large object");
DATA(insert OID = 3459 ( lo_get PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 17 "26 20 23" _null_ _null_ _null_ _null_ lo_get_fragment _null_ _null_ _null_ ));
extern Datum lo_creat(PG_FUNCTION_ARGS);
extern Datum lo_create(PG_FUNCTION_ARGS);
-extern Datum lo_create_bytea(PG_FUNCTION_ARGS);
+extern Datum lo_from_bytea(PG_FUNCTION_ARGS);
extern Datum lo_open(PG_FUNCTION_ARGS);
extern Datum lo_close(PG_FUNCTION_ARGS);
\set newloid_1 :LASTOID
-SELECT lo_create(0, lo_get(:newloid_1)) AS newloid_2
+SELECT lo_from_bytea(0, lo_get(:newloid_1)) AS newloid_2
\gset
SELECT md5(lo_get(:newloid_1)) = md5(lo_get(:newloid_2));
\lo_unlink :newloid
\lo_import 'results/lotest.txt'
\set newloid_1 :LASTOID
-SELECT lo_create(0, lo_get(:newloid_1)) AS newloid_2
+SELECT lo_from_bytea(0, lo_get(:newloid_1)) AS newloid_2
\gset
SELECT md5(lo_get(:newloid_1)) = md5(lo_get(:newloid_2));
?column?
\lo_unlink :newloid
\lo_import 'results/lotest.txt'
\set newloid_1 :LASTOID
-SELECT lo_create(0, lo_get(:newloid_1)) AS newloid_2
+SELECT lo_from_bytea(0, lo_get(:newloid_1)) AS newloid_2
\gset
SELECT md5(lo_get(:newloid_1)) = md5(lo_get(:newloid_2));
?column?