View Single Post

   
  #2 (permalink)  
Old 04-09-2008, 09:02 AM
Chris
 
Posts: n/a
Default Re: checking data type

raj wrote:
> is there a function that could check for a variable's data type? like
> i want to check all the columns of a table and if i found a column with
> an integer data type i set it to a default 1 and i'll set a constant
> to a column of type text.


You could start psql with -E:

psql -d dbname -E

run \d <tablename>

and use the queries that postgres runs to work it out..

There could be a simpler way though in the system catalogues (anyone?).


I should ask why you need this info

--
Postgresql & php tutorials
http://www.designmagick.com/

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Reply With Quote