Re: Coding help - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: Coding help
Date
Msg-id 3FAE128A.1080200@familyhealth.com.au
Whole thread Raw
In response to Re: Coding help  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Coding help
Re: Coding help
List pgsql-hackers
> The only idea I have is to call oidin() to do the conversion from string
> to oid.  I see this in copy.c:
> 
>                     loaded_oid = DatumGetObjectId(DirectFunctionCall1(oidin,
>                                                CStringGetDatum(string)));
>                     if (loaded_oid == InvalidOid)
>                         ereport(ERROR,
>                                 (errcode(ERRCODE_BAD_COPY_FILE_FORMAT),
>                                  errmsg("invalid OID in COPY data")));
> 
> I would give that a try.

Yes but in this case, the Node is parsed like this:

| COMMENT ON LARGE OBJECT NumericOnly IS comment_text
{
 ...

 n->objname = makeList1(makeAConst($5));
 ...
 $$ = (Node *) n;
}

So there is no CString to convert to a Datum...

Chris





pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: bugzilla (Was: What do you want me to do?)
Next
From: Bruce Momjian
Date:
Subject: Re: Coding help