If you're going to truncate the NOW(), just go with CURRENT_DATE instead.
Thanks for the "CURRENT_DATE" tip, Adam. Works fine!
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
OK, so you want to see if a timestamp is greater than now()? Why not
just compare them?
where a.from_datetime >= now()
No, not the whole timestamp. I dont want to check the time.
So I had to truncate the datetime with:
date_trunc('day', a.from_datetime) >= date_trunc('day', NOW())
--
Sent
This query makes little sense. Why are you trying to convert a
timestamp to a timestamp? Is this a bizarre substitute for date_trunc()?
Got it:
Thanks for the "date_trunc" tip.
This query works fine:
date_trunc('day', a.from_datetime) >= date_trunc('day', NOW())
--
Sent via pgsql-general m
This query makes little sense. Why are you trying to convert a
timestamp to a timestamp? Is this a bizarre substitute for date_trunc()?
The "from_datetime" column is of type "timestamp" but I want to check
only the date, not the time.
In this example I want to retrieve all records whose "fr
Dear list members
I have upgraded my PostgreSQL 8.2.6 to 8.3.6 and I am having trouble
with calling "to_timestamp" function.
Here is the query I use:
SELECT a.*
FROM tblevent a
WHERE to_timestamp(a.from_datetime,'/MM/DD') >= to_timestamp(
NOW(),'/MM/DD' )
ORDER BY a.from_dat
Dear list members,
I am trying to install Postgresql-8.2.3 on a Suse Linux Enterprise
Server 10.1 64-Bit with Python 2.4.4. At the "gmake" command I get 2
errors (see below).
I ran:
./configure --with-python --with-openssl
gmake
Here are the last lines of the gmake process:
It does allow you to sort on both columns.
SELECT DISTINCT ON (path) path, comment_id, created, title
FROM bewertungen.tblcomments ORDER BY path, created
Thank you very much. Works perfect! :-)
---(end of broadcast)---
TIP 3: Have you
Hi there,
I have a problem sorting a SQL result if I use DISTINCT ON.
I have a table "tblcomment" with these columns:
id (serial)
path (varchar)
created (timestamp)
title (varchar)
These records are in the table "tblcomment":
id pathcreated title
--
Dear list members,
I would like to enable logging and write every SQL command that is
executed in a logfile so I modified the "postgresql.conf" file in order
to log everything. I restarted the Postgres SQL server. Unfortunately,
no SQL statements are logged in the logfile.
Here is a snippet
Dear list members,
I have a web application running that is connected to my postgres
database. This web application builds dynamically SQL queries and
queries the postgres database. I would like to see these SQL queries.
How can I do this? Is there a way to monitor the SQL queries which are
s
Take a look at the docs, in particular the three-parameter version of
setval and the is_called flag.
http://www.postgresql.org/docs/current/interactive/functions- sequence.html
Thanks Michael,
SELECT setval('tblperson_id_seq', 1, false);
will do exactly what I supposed to get.
Nico
Hi there,
I would like to reset a sequence so its id will start with 1 if I insert
a new record into the table, after I have deleted all records from the
table.
I am using Postgres 8.03 and here is what I tried:
test=# create table tblperson (
test(# id SERIAL NOT NULL,
test(# name VARCHAR(2
I have a problem when sorting records with:
SELECT * FROM table WHERE name LIKE 'Ö%'
I am running Postgres 8.02 with a database whose character encoding is
UNICODE.
The SQL Query
SELECT *
FROM member
WHERE name LIKE 'O%'
OR
name like 'Ö%'
ORDER BY name
re
Ah, I found it:
lc_collate: [EMAIL PROTECTED]
lc_ctype: [EMAIL PROTECTED]
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
... but what locale is it using? (See LC_COLLATE and LC_CTYPE.)
Can I find out out these settings in "phpPgAdmin"?
Or can I use LC_COLLATE and LC_CTYPE in the SQL Query?
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ig
Hi there,
I have a problem when sorting records with:
SELECT * FROM table WHERE name LIKE 'Ö%'
I am running Postgres 8.02 with a database whose character encoding is
UNICODE.
The SQL Query
SELECT *
FROM member
WHERE name LIKE 'O%'
OR
name like 'Ö%'
ORDER BY
16 matches
Mail list logo