From: | "Mats Ekelund" <mats(dot)ekelund(at)zenon(dot)se> |
---|---|
To: | "Kris Jurka" <books(at)ejurka(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Issue with DataBaseMetaData.GetTypeInfo() |
Date: | 2008-04-07 11:19:18 |
Message-ID: | c2dd00540804070419v60216e0fp998e66b56b320e6d@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Here is a more general solution: the mapping is done for SQL types
since it should be a fixed number of types.
Mats Ekelund
2008/3/31, Kris Jurka <books(at)ejurka(dot)com>:
> Mats Ekelund wrote:
> >
> > I have attached the patch.
> >
>
> Please keep the mailing list CCed so all can see/participate in the
> discussion.
>
> + else if ( typname.equals("varchar") || typname.equals("char")
> || typname.equals("text") ||
> + typname.equals("name") || typname.equals("timestamp")
> || typname.equals("timestamptz") )
> + {
> + tuple[3] = connection.encodeString("'");
> + tuple[4] = connection.encodeString("'");
> + }
>
>
> Your patch hard codes this for a couple of types, but it doesn't seem to be
> a general solution. It seems impossible to enumerate all the possible types
> that require quoting. What about any user defined types, we can't possible
> know what those are in the driver?
>
> If you were going to hardcode a list, you need to hardcode the list of types
> that don't require quoting because that should at least be a fixed list. A
> more general solution would be to put this information into TypeInfoCache so
> you could say something like
> TypeInfoCache.requiresQuoting(typeOid).
>
> Kris Jurka
>
Attachment | Content-Type | Size |
---|---|---|
mychanges.patch | text/plain | 2.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Rafael Barrera Oro | 2008-04-07 14:35:22 | PostgreSQL FUNCTION return problem |
Previous Message | Craig Ringer | 2008-04-07 10:51:10 | Re: Hibernate / other ORM and pg_advisory_lock |