views:

132

answers:

1

I have a table in my pgsql database with columns named "type", "desc", and "start". When I call $dbh->column_info, only "desc" comes back quoted, whereas in pgAdmin3 all three of them are quoted. Is one of them wrong?

+2  A: 

I think I kind of answered my own question, but I thought I'd put it on here in case anyone has more insight. The reserve list shows "desc" is the only actually reserved keyword (the other two: 'we classify as "non-reserved" those key words that are explicitly known to the parser but are allowed as column or table names'), so my guess is that pgAdminIII is being cautious and quoting in case "type" and "start" become reserved some day.

Kev
Sounds like the right conclusion. You could use 'delimited identifiers' (the technical name for column names in quotes) everywhere; it is simpler not to.
Jonathan Leffler
True, I only use them where I have to.
Kev