472,348 Members | 1,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,348 software developers and data experts.

Retrieving a column comment

Hi,

I can't seem to retrieve a comment on a table column. The following copy from
psql should I think return a comment:

====================
mydatabase=> COMMENT ON COLUMN car.manufacturer IS 'manufacturer name';
COMMENT
mydatabase=> SELECT relnamespace FROM pg_class WHERE relname='car';
relnamespace
--------------
2200
(1 row)

mydatabase=> SELECT col_description(2200,1);
col_description
-----------------

(1 row)

====================
i.e. it just returns a blank row.

The col_description is described at
http://www.postgresql.org/docs/7.3/s...ions-misc.html
The field number supplied above '1' is right if the first col in a table is
'0', in fact no number I've tried returns anything.

I can't seem to find any examples at all on the web about retrieving column
COMMENTs. Has anyone done this? Postgres version is 7.3

Regards,

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

Nov 12 '05 #1
3 6407
On Sun, Oct 26, 2003 at 10:02:22PM +0000, Oliver Kohll wrote:
I can't seem to retrieve a comment on a table column. The following copy from
psql should I think return a comment:

mydatabase=> SELECT relnamespace FROM pg_class WHERE relname='car';
relnamespace
--------------
2200
(1 row)


Try using relfilenode instead of relnamespace.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Hay que recordar que la existencia en el cosmos, y particularmente la
elaboración de civilizaciones dentre de él no son, por desgracia,
nada idílicas" (Ijon Tichy)

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2
On Sunday 26 October 2003 23:03, Alvaro Herrera wrote:
On Sun, Oct 26, 2003 at 10:02:22PM +0000, Oliver Kohll wrote:
I can't seem to retrieve a comment on a table column. The following copy
from psql should I think return a comment:

mydatabase=> SELECT relnamespace FROM pg_class WHERE relname='car';
relnamespace
--------------
2200
(1 row)


Try using relfilenode instead of relnamespace.


Great, thanks Alvaro. The webpage I found the original code in must have been
wrong but that's it.

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

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #3
Alvaro Herrera <al******@dcc.uchile.cl> writes:
On Sun, Oct 26, 2003 at 10:02:22PM +0000, Oliver Kohll wrote:
I can't seem to retrieve a comment on a table column. The following copy from
psql should I think return a comment:

mydatabase=> SELECT relnamespace FROM pg_class WHERE relname='car';
relnamespace
--------------
2200
(1 row)
Try using relfilenode instead of relnamespace.


Actually what he wants is the oid. relfilenode is not relevant to
anything except the table's disk file name.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Shino | last post by:
Hi, Can anyone help with this error: "ORA-00904: invalid column name"? Thanks! SQL> create view PPFa as 2 SELECT L.UserID AS LecID, U.Name,...
5
by: windandwaves | last post by:
Hi Gurus Is there a way to retrieve the table comment from a mysql table. In PHP My Admin, you can set the comment for a table. however, I was...
6
by: Dean Slindee | last post by:
Does anybody have an actual example of retrieving an Image data type column from a SQL Server table using a dataset (not a datareader)? I would...
1
by: Brett Magill | last post by:
Hello all, Looking for some help here. BTW, to e-mail me directly, should you prefer, take the *nomail*. out the reply address. I uploaded...
6
by: AlveenX | last post by:
Hi, I am trying to pick a Guid from a data row using the following code: foreach(DataRow row in MyDataTable.Rows) { (Guid)row }
5
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is...
9
ADezii
by: ADezii | last post by:
One question which pops up frequently here at TheScripts is: 'How do I retrieve data from a Recordset once I've created it?' One very efficient, and...
3
ADezii
by: ADezii | last post by:
Last Tip, we demonstrated the technique for retrieving data from a DAO Recordset, and placing it into a 2-dimensional Array using the GetRows()...
4
by: ShadowLocke | last post by:
Hi, I have a table that has a column with name "comment" in it. I think that "comment" is an oracle keyword so i would like to rename this column....
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.