So, I'm recording the timestamp from some unix files.
Any opinions as to whether it's best to use a "bigint"
(which matches the file system data) or a "timestamp"
(which might be easier to manipulate in the database)?
TIA!
Mark
--
Mark Harrison
Pixar Animation Studios
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings 4 2358
However it may be represented, it IS a timestamp, so why not use a timestamp
data type if you have one available to you? That's what data types are for
after all... So, I'm recording the timestamp from some unix files.
Any opinions as to whether it's best to use a "bigint" (which matches the file system data) or a "timestamp" (which might be easier to manipulate in the database)?
---------------------------(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
Mark Harrison <mh@pixar.com > wrote: So, I'm recording the timestamp from some unix files.
Any opinions as to whether it's best to use a "bigint" (which matches the file system data) or a "timestamp" (which might be easier to manipulate in the database)?
I tend to choose datatypes that lend themselves to easily and clearly
viewing and manipulating the data with the command-line utility, unless
there's a very good reason to do otherwise.
PostgreSQL has a rich complement of operators and functions for working
with timestamp values, so I'd tend to stick with that, I think.
Jim
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly
Exactly, with using 'timestamp' you gain data integrity as the database
will make sure that it only accepts valid timestamps. So, if your code
that you use to INSERT gets skewed someway, it will fail if you try to
insert an invalid number.
-Robby
On Fri, 2004-07-30 at 14:26, Glen Parker wrote: However it may be represented, it IS a timestamp, so why not use a timestamp data type if you have one available to you? That's what data types are for after all...
So, I'm recording the timestamp from some unix files.
Any opinions as to whether it's best to use a "bigint" (which matches the file system data) or a "timestamp" (which might be easier to manipulate in the database)?
---------------------------(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
--
Robby Russell | Owner.Developer .Geek
PLANET ARGON | www.planetargon.com
Portland, OR | ro***@planetarg on.com
503.351.4730 | blog.planetargo n.com
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org
Also, there is the ability to write code that behaves a certain way
based on the data type.
For example, say you have a PHP script and you want all dates that
display on the page to be displayed with January 1, 2004, you could
program your code in a fashion that would do this should a datatype
'timestamp' be determined as the data type. This comes in handy when you
build generic things like reporting engines that you don't necessarily
know what data is coming to you, but know the data types.
-Robby
On Fri, 2004-07-30 at 16:52, Robby Russell wrote: Exactly, with using 'timestamp' you gain data integrity as the database will make sure that it only accepts valid timestamps. So, if your code that you use to INSERT gets skewed someway, it will fail if you try to insert an invalid number.
-Robby
On Fri, 2004-07-30 at 14:26, Glen Parker wrote: However it may be represented, it IS a timestamp, so why not use a timestamp data type if you have one available to you? That's what data types are for after all...
So, I'm recording the timestamp from some unix files.
Any opinions as to whether it's best to use a "bigint" (which matches the file system data) or a "timestamp" (which might be easier to manipulate in the database)?
---------------------------(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
--
Robby Russell | Owner.Developer .Geek
PLANET ARGON | www.planetargon.com
Portland, OR | ro***@planetarg on.com
503.351.4730 | blog.planetargo n.com
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: kingofkolt |
last post by:
All,
What do you recommend as the best type of field for a timestamp in a MySQL
database? I've considered varchar(10) or INT but I'm not sure what is the
best, most efficient, and most reliable field type.
Thanks.
- JP
|
by: maxim vexler |
last post by:
in a book i am ready now : O'Reilly - Web Database Application with PHP
and MySQL, 2nd ed. by David Lane, Hugh E. Williams
on chapter 9 the author give an example for age validation :
(simplified code, not a direct quote)
$dob = mktime(0,0,0, 5, 3, 1983);
if ((float)$dob > (float)strtotime("-18years"))
{
|
by: dgaucher |
last post by:
Hi,
I want to consume a Web Service that returns a choice, but my C++ client
always receives the same returned type. On the other hand, when I am using a
Java client, it is working fine (of course, the generated proxy is not the
same).
When I am looking at the C++ generated code, it seems fine, but when I am
executing the code, I always get the first choice type.
|
by: Casey |
last post by:
Hi! I found several resources describing how to convert the UNIX timestamp to
a readable date, however I need to convert a date into a UNIX timestamp.
For instance, I'm writing a program that will be querying an Oracle
database, and I need to select data that falls between a certain date. All
the dates are stored as UNIX timestamps. So, I need a way to convert a date -
like April 1st, 2005 - to the unix timestamp... I thought to use the...
|
by: DrUg13 |
last post by:
In java, this seems so easy. You need a new object
Object test = new Object() gives me exactly what I want.
could someone please help me understand the different ways to do the
same thing in C++. I find my self sometimes, trying
Object app = Object();
Object *app = Object();
Object app = new Object();
| |
by: John Reese |
last post by:
Hi.
>>> import time, calendar, datetime
>>> n= 1133893540.874922
>>> datetime.datetime.fromtimestamp(n)
datetime.datetime(2005, 12, 6, 10, 25, 40, 874922)
>>> lt= _
>>> datetime.datetime.utcfromtimestamp(n)
datetime.datetime(2005, 12, 6, 18, 25, 40, 874922)
>>> gmt= _
|
by: anwar |
last post by:
Hi all,
Im trying to extract db2 server current system timestamp from unix
shell script. So from shell script call the export command " db2
export to curdate.txt of del modified by chardel' ' select current
timestamp from sysibm.sysdummy1".
when i run the script im getting error curdate.txt file or directory
does not exsist...
but if i remove the modifier "modified by chardel' '", then system
|
by: marc |
last post by:
hi
im trying to convert Date() into a unix timestamp so i can stick the
result into a mysql db, please help!
|
by: mike.lussier |
last post by:
I have written some simple XSL pages to extract the data I need but
each device here has a total of 6 keys and within this 6 values a time
stamp and how long until the next data extraction ( 300 seconds ) 5
minutes.
The page starts off with WebBox
Then goes to MeanPublic
How can I extract the "<Firstdata from the 6 Keys for that device ?
My coding so far has only revealled the first key and nothing more.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |