By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,420 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,420 IT Pros & Developers. It's quick & easy.

Refer to n'th field of a table?

P: n/a
Hi,

Sorry for asking the dynamic command question without thoroughly reading the
documentation first.
Thanks a lot for your reply, Richard. ;-)

Now this may be a naive SQL question:
Is there any way to refer to the nth field of a table? For example, when I
already know the schema of
a table( I know it's first field is integer, second and third are text), but
don't know the field names,
is there any way to simply refer to the field by it's position in the table
rather than it's field name?
Also the same question goes with a record(row)?

Many thanks,

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

Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
On Thursday 19 February 2004 19:22, Wei Wang wrote:
Hi,

Sorry for asking the dynamic command question without thoroughly reading
the documentation first.
Thanks a lot for your reply, Richard. ;-)

Now this may be a naive SQL question:
Is there any way to refer to the nth field of a table? For example, when I
already know the schema of
a table( I know it's first field is integer, second and third are text),
but don't know the field names,
is there any way to simply refer to the field by it's position in the table
rather than it's field name?
It is possible if you use libpq i.e. C API to access database. You can access
the field value either by name or number.
Also the same question goes with a record(row)?


Yes. With C API it is possible.

Check
http://www.postgresql.org/docs/7.4/s...EC-SELECT-INFO

Shridhar

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.