Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e94dc73

Browse files
committed
fixup! Fix queues and tests
1 parent ef73920 commit e94dc73

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

jsonbd.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,14 @@ jsonbd_compress(CompressionMethodOptions *cmoptions, const struct varlena *data)
743743
static void
744744
jsonbd_configure(Form_pg_attribute attr, List *options)
745745
{
746-
if (options != NIL)
747-
elog(ERROR, "the compression method for jsonbd doesn't take any options");
746+
if (!OidIsValid(jsonbd_get_dictionary_relid()))
747+
elog(ERROR, "could not create jsonbd dictionary");
748+
}
749+
750+
static void
751+
jsonbd_drop(Form_pg_attribute attr, List *options)
752+
{
753+
/* TODO: if there is no compression options, remove the dictionary */
748754
}
749755

750756
static struct varlena *
@@ -836,7 +842,7 @@ jsonbd_compression_handler(PG_FUNCTION_ARGS)
836842
elog(ERROR, "unexpected type %d for jsonbd compression handler", typeid);
837843

838844
cmr->configure = jsonbd_configure;
839-
cmr->drop = NULL;
845+
cmr->drop = jsonbd_drop;
840846
cmr->compress = jsonbd_compress;
841847
cmr->decompress = jsonbd_decompress;
842848

jsonbd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ typedef struct jsonbd_worker_args
7474

7575
extern void _PG_init(void);
7676
extern void jsonbd_register_launcher(void);
77+
extern Oid jsonbd_get_dictionary_relid(void);
7778

7879
extern void *workers_data;
7980
extern int jsonbd_nworkers;

jsonbd_worker.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Oid jsonbd_id_indoid = InvalidOid;
4747

4848
void jsonbd_worker_main(Datum arg);
4949
void jsonbd_launcher_main(Datum arg);
50-
static Oid jsonbd_get_dictionary_relid(void);
5150
static bool jsonbd_register_worker(int, Oid, int);
5251

5352
#define JSONBD_DICTIONARY_REL "jsonbd_dictionary"
@@ -832,7 +831,7 @@ jsonbd_register_launcher(void)
832831
RegisterBackgroundWorker(&worker);
833832
}
834833

835-
static Oid
834+
Oid
836835
jsonbd_get_dictionary_relid(void)
837836
{
838837
Oid relid,

0 commit comments

Comments
 (0)