to my last letter about embedded SQL
Well, I investigated the problem and found out, that in fact, the table is
'created', because the file representing the table called
/usr/local/pgsql/data/base/szoli1/perftest EXISTS, but can't reach neither
via psql nor via pgaccess. But can't create a table with the same name:
szoli1=> create table perftest(number int4);
ERROR: cannot create perftest
ERROR: cannot create perftest
So there's some inconsistence in PostgreSQL.
When I found out what happened, removed the whole postgreSQL package and
reinstalled it from scratch. But when runned the program again got the
same results. However psql and pgaccess works fine when I create a table
with them and fill these tables with data.
If anyone has some idea what to do please mail me.
Thanks in advance
Sebesty���n Zolt���n
P.S.: I forgot to describe my system: It's a FreeBSD-2.2.7-RELEASE system
running on a PII-300 box
--------------------------------------------------------------------------------
Sebesty���n Zolt���n AKA Memphisto It all seems so stupid,
it makes me want to give up.
szoli@neumann.cs.elte.hu But why should I give up,
when it all seems so stupid?
MAKE INSTALL NOT WAR And please avoid Necrosoft Widows
I have a table with somedate defined as date.
I want to select all rows that are from todays date back to 7 days
ago. Or in this case 10-1-1998.
data in the somedate fields appear as: 10-7-1998
Can someone help?
Thanks in advance
I have a table with somedate defined as date.
I want to select all rows that are from todays date back to 7 days
ago. Or in this case 10-1-1998.
Use the function age() somewhat like this:
select * from sometable
where date_part( 'epoch' , age( 'now', somedate ) ) > 604800
The 'epoch' date part is the total number of seconds between the two dates.
For other variations, see:
Import Notes
Resolved by subject fallback
I have a table with somedate defined as date.
I want to select all rows that are from todays date back to 7 days
ago. Or in this case 10-1-1998.Use the function age() somewhat like this:
select * from sometable
where date_part( 'epoch' , age( 'now', somedate ) ) > 604800The 'epoch' date part is the total number of seconds between the two
dates.
For other variations, see:
Why don't you just use between:
select * from sometable
where somedate between now()::date and (now()::datetime - '@ 7
days'::timespan)::date;
-DEJ
Import Notes
Resolved by subject fallback
I tried this but, got the following:
---------------------------------------
mytest=> select fagentname from feedback where ftdate between now()::date and
mytest-> (now()::datetime - '@ 7 days'::timespan)::date;
ERROR: function date(timestamp) does not exist
---------------------------------------
I have this column identified as type date and not timestamp.
Any suggestions?
On Thu, 8 Oct 1998, Jackson, DeJuan wrote:
Show quoted text
I have a table with somedate defined as date.
I want to select all rows that are from todays date back to 7 days
ago. Or in this case 10-1-1998.Use the function age() somewhat like this:
select * from sometable
where date_part( 'epoch' , age( 'now', somedate ) ) > 604800The 'epoch' date part is the total number of seconds between the two
dates.
For other variations, see:Why don't you just use between:
select * from sometable
where somedate between now()::date and (now()::datetime - '@ 7
days'::timespan)::date;
-DEJ
I tried this but, got the following:
---------------------------------------
mytest=> select fagentname from feedback where ftdate between
now()::date and
mytest-> (now()::datetime - '@ 7 days'::timespan)::date;
ERROR: function date(timestamp) does not exist
---------------------------------------I have this column identified as type date and not timestamp.
try:
SELECT fagentname
FROM feedback
WHERE '@ 7 days'::timespan >= ftdate::datetime - now()::datetime;
Show quoted text
Any suggestions?
On Thu, 8 Oct 1998, Jackson, DeJuan wrote:
I have a table with somedate defined as date.
I want to select all rows that are from todays date back to 7 days
ago. Or in this case 10-1-1998.Use the function age() somewhat like this:
select * from sometable
where date_part( 'epoch' , age( 'now', somedate ) ) > 604800The 'epoch' date part is the total number of seconds between the
two
dates.
For other variations, see:Why don't you just use between:
select * from sometable
where somedate between now()::date and (now()::datetime - '@ 7
days'::timespan)::date;
-DEJ
Import Notes
Resolved by subject fallback