This is a discussion on Re: executing a procedure withing a procedure? within the pgsql Novice forums, part of the PostgreSQL category; --> > What do I add on the front end in order to bid the form to a view when ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| > What do I add on the front end in order to bid the form to a view when > updating data? Don't forget to copy the list when you have a question so that other can reply also. I am not sure I understand your first question. But if you want to bind a view to a form in ms-access, look at: http://www.postgresql.org/download/ under application interfaces -- odbc > Also, the procedure I need to write are for a report in access. How would I > link the procedure to the report? I do have several parameters for the > procedure, so any advice is welcome. hmm.. I never tried binding a report to a pl-pgsql function before. I imagine that you could do it through a pass-through query where you: select * from <your_function>; Alternitivly, you could create a view in postgresql that is a "select * from <your_function>" and then bind your report to that view. Regards, Richard Broersma Jr. ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| Good Monday, Is there a way to convert data type `datetime` into an integer (unix_timestamp) while doing ALTER COLUMN `column_name` TYPE int4 USING CAST(`column_name` as integer) ...... something like this? Thanks, Mike E. ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| On Mon, Aug 14, 2006 at 08:00:59AM -0400, Mike Ellsworth wrote: hi, > Is there a way to convert data type `datetime` into an integer > (unix_timestamp) while doing ALTER COLUMN `column_name` TYPE int4 > USING CAST(`column_name` as integer) ...... something like this? i dont know, if it solves your problem - for reading i usually cast like this: EXTRACT(EPOCH FROM ts) as ts and for writing: ts::int4::abstime::timestamp -- cu -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkTgZ0kACgkQOO9i6TSuoN2afgCbBYTt3rCKSJ lnDw33ynR6FjCY UOoAn2JZqQXSW+jc/F7mIOAg3tbI9PzR =Teu3 -----END PGP SIGNATURE----- |
| |||
| On Mon, Aug 14, 2006 at 08:00:59AM -0400, Mike Ellsworth wrote: > Is there a way to convert data type `datetime` into an integer There is no datetime type. Do you mean timestamp or timestamp with time zone? > (unix_timestamp) while doing ALTER COLUMN `column_name` TYPE int4 > USING CAST(`column_name` as integer) ...... something like this? Is this what you're looking for? ALTER TABLE foo ALTER COLUMN column_name TYPE integer USING extract(epoch FROM column_name); -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| Mike Ellsworth <nhrcommu@rochester.rr.com> writes: > Is there a way to convert data type `datetime` into an integer > (unix_timestamp) while doing ALTER COLUMN `column_name` TYPE int4 > USING CAST(`column_name` as integer) ...... something like this? Something involving extract(epoch) would do that ... but why do you want to? If the column is really timestamps then you are almost always best off to declare it as timestamps. When you have a client that wants a numeric version, they can do the extract(epoch) bit when they select the data (or you can make a view that does so, if the client code is too brain-dead to manage it for itself). The normal rule of good database design is that the database should have as much knowledge as possible about what it's storing, not as little as possible. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| ||||
| Tom Lane wrote: >Mike Ellsworth <nhrcommu@rochester.rr.com> writes: > > >>Is there a way to convert data type `datetime` into an integer >>(unix_timestamp) while doing ALTER COLUMN `column_name` TYPE int4 >>USING CAST(`column_name` as integer) ...... something like this? >> >> > >Something involving extract(epoch) would do that ... but why do you >want to? If the column is really timestamps then you are almost always >best off to declare it as timestamps. When you have a client that wants >a numeric version, they can do the extract(epoch) bit when they select >the data (or you can make a view that does so, if the client code is >too brain-dead to manage it for itself). The normal rule of good >database design is that the database should have as much knowledge >as possible about what it's storing, not as little as possible. > > regards, tom lane > Actually, we do not have a specific purpose in mind. We're trying to make a simple GUI that will allow users to do this if they (for whatever the reason) feel the need. Your point is a good one though and we should probably include a Javascript warning for this particular 'feature'. Thanks, Mike > > > |