pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to modify type in table?
5+ messages / 5 participants
[nested] [flat]
* How to modify type in table?
@ 2001-01-30 03:22 Jaruwan Laongmal <jaruwan@gits.net.th>
0 siblings, 3 replies; 5+ messages in thread
From: Jaruwan Laongmal @ 2001-01-30 03:22 UTC (permalink / raw)
To: pgsql-hackers@postgresql.org; pgsql-sql
Dear Sir.
Would you like to inform me how to modify type in table?
For example , I define type as varchar(14) , but I want to modify to varchar(120). How to do this.
Thank you so much
Jaruwan
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to modify type in table?
@ 2001-01-30 03:49 Manuel Cabido <manny@msuiit.edu.ph>
parent: Jaruwan Laongmal <jaruwan@gits.net.th>
2 siblings, 1 reply; 5+ messages in thread
From: Manuel Cabido @ 2001-01-30 03:49 UTC (permalink / raw)
To: Jaruwan Laongmal <jaruwan@gits.net.th>; +Cc: pgsql-hackers@postgresql.org; pgsql-sql
Hi there,
I am compiling postgresql 7.1beta4. How would i change the 8k row
limit?
--
Manny C. Cabido
====================================
e-mail:manny@tinago.msuiit.edu.ph
manny@sun.msuiit.edu.ph
=====================================
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [HACKERS] How to modify type in table?
@ 2001-01-30 12:22 Oliver Elphick <olly@lfix.co.uk>
parent: Jaruwan Laongmal <jaruwan@gits.net.th>
2 siblings, 0 replies; 5+ messages in thread
From: Oliver Elphick @ 2001-01-30 12:22 UTC (permalink / raw)
To: Jaruwan Laongmal <jaruwan@gits.net.th>; +Cc: pgsql-sql
"Jaruwan Laongmal" wrote:
>Would you like to inform me how to modify type in table?
>For example , I define type as varchar(14) , but I want to modify to varcha=
>r(120). How to do this.
There is no facility to do this directly. (Allowing columns to change
their type would possibly involve rewriting the entire table.)
You can use pg_dump to dump either a database or a particular table. Then
you can edit the CREATE TABLE command in the dump output and then create a
new database or table from the dump.
If the table in question is not referenced by any other objects, dump
it (pg_dump -t table database >dump); edit the dump; delete or rename the
old table; and finally restore the dump (psql -d database <dump).
If the table is the target of RI references, triggers, rules and so on, it
is easiest to use pg_dump to dump the whole database, (This is because the
table is referenced by oid, not by name, and recreating the table will
make it seem to disappear from all those references.)
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The Lord knoweth how to deliver the godly out of
temptations, and to reserve the unjust unto the day of
judgment to be punished;" II Peter 2:9
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to modify type in table?
@ 2001-02-05 17:39 Albert REINER <areiner@tph.tuwien.ac.at>
parent: Jaruwan Laongmal <jaruwan@gits.net.th>
2 siblings, 0 replies; 5+ messages in thread
From: Albert REINER @ 2001-02-05 17:39 UTC (permalink / raw)
To: pgsql-sql
Saluton,
On Tue, Jan 30, 2001 at 10:22:23AM +0700, Jaruwan Laongmal wrote:
> Dear Sir.
> Would you like to inform me how to modify type in table?
> For example , I define type as varchar(14) , but I want to modify to varchar(120). How to do this.
If it is not too much data, the easiest would be to use pg_dump to
dump the database (or just the table), edit the definition, and feed
the changed file to psql in order to get the data back. Or you can
create a different table with the correct structure, copy the data
there, drop the old table, rename the new one to the correct one.
Albert.
--
--------------------------------------------------------------------------
Albert Reiner <areiner@tph.tuwien.ac.at>
Deutsch * English * Esperanto * Latine
--------------------------------------------------------------------------
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to modify type in table?
@ 2001-02-06 04:48 Thomas Lockhart <lockhart@alumni.caltech.edu>
parent: Manuel Cabido <manny@msuiit.edu.ph>
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lockhart @ 2001-02-06 04:48 UTC (permalink / raw)
To: Manuel Cabido <manny@msuiit.edu.ph>; +Cc: Jaruwan Laongmal <jaruwan@gits.net.th>; pgsql-hackers@postgresql.org; pgsql-sql
> I am compiling postgresql 7.1beta4. How would i change the 8k row
> limit?
There is no 8k row limit anymore. But if there were, you would modify a
#define in the source code and recompile (check the docs for more
details).
- Thomas
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-02-06 04:48 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-30 03:22 How to modify type in table? Jaruwan Laongmal <jaruwan@gits.net.th>
2001-01-30 03:49 ` Manuel Cabido <manny@msuiit.edu.ph>
2001-02-06 04:48 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
2001-01-30 12:22 ` Oliver Elphick <olly@lfix.co.uk>
2001-02-05 17:39 ` Albert REINER <areiner@tph.tuwien.ac.at>
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