type of a field

type of a field

am 02.05.2002 11:48:39 von ameen eetemadi

Hello
I want to know the type of a field in a table
how can I khow it ?

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: type of a field

am 02.05.2002 16:59:56 von Keary Suska

on 5/2/02 3:48 AM, ameen78101@yahoo.com purportedly said:

> Hello
> I want to know the type of a field in a table
> how can I khow it ?

There are different ways. You can use pg_field_type(), or a Postgres
function. It's all in the docs. RTFM.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Re: type of a field

am 02.05.2002 18:49:03 von Josh Berkus

Ameen,

> I want to know the type of a field in a table
> how can I khow it ?

Way #1:
1. Log into to your database using the command line utility PSQL.
2. Type "\d "

Way #2:
1. Install phpPgAdmin database administration tool.
2. Examine the table using phpPgAdmin.

-Josh

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Re: type of a field

am 03.05.2002 09:46:20 von duncan.adams

Would pg_fieldname() and pg_fieldtype() also be an option?

-----Original Message-----
From: Josh Berkus [mailto:josh@agliodbs.com]
Sent: Thursday, May 02, 2002 6:49 PM
To: ameen eetemadi; pgsql-php@postgresql.org
Subject: Re: [PHP] type of a field


Ameen,

> I want to know the type of a field in a table
> how can I khow it ?

Way #1:
1. Log into to your database using the command line utility PSQL.
2. Type "\d "

Way #2:
1. Install phpPgAdmin database administration tool.
2. Examine the table using phpPgAdmin.

-Josh

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Re: type of a field

am 07.05.2002 17:09:27 von duncan.adams

Hi

1 u will have to use alter table to change the tables name RTFM
2 then create the new table with the changed columns
3 then insert into values (select oldcolumn as newcolumn, ect...
from );

but i did not read u'r question correctly.

i would do steps 1 and 2 above and then write a function in php
that

select * from

and

insert into


-----Original Message-----
From: ameen eetemadi [mailto:ameen78101@yahoo.com]
Sent: Tuesday, May 07, 2002 3:01 PM
To: pgsql-php@postgresql.org
Subject: [PHP] type of a field


I want to change the type of a field in postgres.
How can I do it ?

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

---------------------------(end of broadcast)---------------------------
TIP 3: 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

Re: type of a field

am 07.05.2002 17:20:34 von Dan Wilson

You can't yet... at least not with an ALTER statement. The only way to
currenty do this is by dumping the table (through pg_dump), altering the type
of the field, and then re-ipmorting the table.

Rumor has it that they are working on an ALTER statement to accomplish this
for 7.3 or 7.4.

-Dan

Quoting ameen eetemadi :

> I want to change the type of a field in postgres .
> How can I do it ?


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: type of a field

am 08.05.2002 04:09:01 von Christopher Kings-Lynne

> You can't yet... at least not with an ALTER statement. The only way to
> currenty do this is by dumping the table (through pg_dump),
> altering the type
> of the field, and then re-ipmorting the table.
>
> Rumor has it that they are working on an ALTER statement to
> accomplish this
> for 7.3 or 7.4.

Development currently stalled ;) Don't bet on it being there...

Chris


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html