Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
56d982b7
Commit
56d982b7
authored
Jan 17, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mention ALTER COLUMN TYPE in FAQ.
parent
5be1e13d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
doc/FAQ
doc/FAQ
+5
-2
doc/src/FAQ/FAQ.html
doc/src/FAQ/FAQ.html
+7
-4
No files found.
doc/FAQ
View file @
56d982b7
Frequently Asked Questions (FAQ) for PostgreSQL
Last updated: Sun Jan 16 2
1:40:18
EST 2005
Last updated: Sun Jan 16 2
2:01:06
EST 2005
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
...
...
@@ -690,7 +690,10 @@ log_*
ALTER TABLE new_table RENAME TO old_table;
COMMIT;
To change the data type of a column, do this:
Changing the data type of a column can be done easily in 8.0 and later
with ALTER TABLE ALTER COLUMN TYPE.
In earlier releases, do this:
BEGIN;
ALTER TABLE tab ADD COLUMN new_col new_data_type;
UPDATE tab SET new_col = CAST(old_col AS new_data_type);
...
...
doc/src/FAQ/FAQ.html
View file @
56d982b7
...
...
@@ -10,7 +10,7 @@
alink=
"#0000ff"
>
<H1>
Frequently Asked Questions (FAQ) for PostgreSQL
</H1>
<P>
Last updated: Sun Jan 16 2
1:40:18
EST 2005
</P>
<P>
Last updated: Sun Jan 16 2
2:01:06
EST 2005
</P>
<P>
Current maintainer: Bruce Momjian (
<A
href=
"mailto:pgman@candle.pha.pa.us"
>
pgman@candle.pha.pa.us
</A>
)
<BR>
...
...
@@ -854,8 +854,8 @@
<H4><A
name=
"4.4"
>
4.4
</A>
) How do you remove a column from a
table, or change its data type?
</H4>
<P><SMALL>
DROP COLUMN
</SMALL>
functionality was added in release 7.3
with
<SMALL>
ALTER TABLE DROP COLUMN
</SMALL>
. In earlier versions,
<P><SMALL>
DROP COLUMN
</SMALL>
functionality was added in release 7.3
with
<SMALL>
ALTER TABLE DROP COLUMN
</SMALL>
. In earlier versions,
you can do this:
</P>
<PRE>
BEGIN;
...
...
@@ -868,7 +868,10 @@
COMMIT;
</PRE>
<P>
To change the data type of a column, do this:
</P>
<P>
Changing the data type of a column can be done easily in 8.0
and later with
<SMALL>
ALTER TABLE ALTER COLUMN TYPE
</SMALL>
.
<P>
In earlier releases, do this:
</P>
<PRE>
BEGIN;
ALTER TABLE tab ADD COLUMN new_col
<i>
new_data_type
</i>
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment