Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: What defines the output format of a Postgres Timestamp

by haukex (Archbishop)
on Jan 27, 2021 at 14:08 UTC ( [id://11127515]=note: print w/replies, xml ) Need Help??


in reply to Re^3: What defines the output format of a Postgres Timestamp
in thread What defines the output format of a Postgres Timestamp

I suspect that the order of columns returned from that type of query is unspecified.

"Unspecified" sounds a bit like it might change when the database table hasn't changed, and that would surprise me if it were the case. It seems different from vendor to vendor, but at least according to this page on the Postgres Wiki, "Postgres currently defines column order based on the attnum column of the pg_attribute table."

  • Comment on Re^4: What defines the output format of a Postgres Timestamp

Replies are listed 'Best First'.
Re^5: What defines the output format of a Postgres Timestamp
by choroba (Cardinal) on Jan 27, 2021 at 14:13 UTC
    The problem is what is considered a table change. What about changing the precision of a column? I'm aware of a (closed source) DB engine which changes the order of columns for some precision changes (namely when the new type takes up more bytes than the old one) but keeps it the same for the rest.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      The problem is what is considered a table change.

      Yes, that's a good point - over in my other replies I've been arguing against SELECT * anyway. I just felt that saying it was "unspecified" was, well, too unspecific :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127515]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found