pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryan White <bryan@arcamax.com>
To: pgsql-interfaces@postgreSQL.org
Subject: Determine data type of columns
Date: Tue, 10 Nov 1998 16:21:26 -0500
Message-ID: <012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com> (raw)

I have a general purpose utilty for entering data into web based forms.  The
function that parses the data and inserts the record into a table is largely
unaware of the structure of the table it is operating on.  I am currenly
having problems with integer fields.  If I blindly quote all fields the back
end will complain about casting on integer fields.  Also I would like to do
some primitive field validation based on type before submitting to the back
end.

This brings me to my question.  The PQftype function returns an OID but I
don't see any documentation on how to interpret it.  Are the values constant
for the built in types (specifically int4, text, and date)?
Do I have to execute another query to determine the actual type?
Is there a way to encode the values in an insert/update statement such that
they will be quietly converted to the proper type on the backend?

I am using 6.3.2 but will be upgrading to 6.4 shortly.  Will that make this
any easier?

Bryan White
ArcaMax Inc.
Yorktown VA
www.arcamax.com




view thread (4+ messages)  latest in thread

Message-ID: <012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com>
Permalink:  ../012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com/
Also on:    postgresql.org/message-id/012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: bryan@arcamax.com
  Subject: Re: Determine data type of columns
  In-Reply-To: <012001be0cf0$131ffb60$a3f0f6ce@bryan.arcamax.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox