I have difficulties understanding how to use variable of "record" or "row"
type. How do I actually insert the variables OLD or NEW or a record type into
a table from within a trigger?
Like doing the following:
drop table th1;
create table th1(
id serial,
text text );
drop table th_audit;
crea
"Josh Berkus" <[EMAIL PROTECTED]> writes:
> Second, you can't alias a JOINed set of tables;
Actually you can, according to my reading of SQL92:
::=
[ [ AS ]
[] ]
| [ AS ]
[]
|
::
Josh Berkus writes:
> 1. The difference between two TIMESTAMPs is always an INTERVAL
> '1999-12-30'::TIMESTAMP - '1999-12-11'::TIMESTAMP = '19 days'::INTERVAL
> 2. You may add or subtract an INTERVAL to a TIMESTAMP to produce another
> TIMESTAMP:
> '1999-12-11'::TIMESTAMP + '19 days':
Oleg,
> Below is the query I am trying to execute and the error I am getting:
> SELECT media
> FROM(dtrowmedia a INNER JOIN dtrow b ON (a.dtrow = b.objectid)) c
> INNER JOIN dtcol d ON (c.dtcol = d.objectid)
First, the "INNER" keyword is not required on Postgres; you may omit
Oleg Lebedev <[EMAIL PROTECTED]> writes:
> What am I doing wrong?
Using 7.0, perhaps? The query parses fine for me in 7.1.
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://www.
Vivek,
> JB> Q. What about TIMESTAMP WITH TIME ZONE?
> JB> A. An important topic, and datatype, that I don't want to get
> into here.
> JB> See the PostgreSQL docs.
>
> Those docs are lacking an explanation that there is no such thing in
> PostgreSQL as a timestamp *without* time zone.
Hmmm .
Jeff,
> Why not just include examples of DATEDIFF and DATEADD functions?
> For example:
> CREATE FUNCTION datediff(timestamp, timestamp)
> RETURNS integer AS '
> BEGIN
> RETURN $2 - $1;
> END;
> ' LANGUAGE 'plpgsql';
Not a bad idea. Unfortunately, DATEDIFF & DATEADD are more complicated
than th
> "JB" == Josh Berkus <[EMAIL PROTECTED]> writes:
>> Those docs are lacking an explanation that there is no such thing in
>> PostgreSQL as a timestamp *without* time zone.
JB> Hmmm OK, I'll revise the A: but I *don't* want to go into Time Zone
JB> issues in this intro. Any docs I can
Hello,
I am trying to execute an SQL query that contains nested joins, but I
get parser error for some reason.
Below is the query I am trying to execute and the error I am getting:
SELECT media
FROM(dtrowmedia a INNER JOIN dtrow b ON (a.dtrow = b.objectid)) c
INNER JOIN dtcol d
--CELKO-- wrote:
>
> >> The table causing my headache:
>
> CREATE TABLE app_components
> (idNUMERIC(7) NOT NULL PRIMARY KEY,
> name VARCHAR(100) NOT NULL,
> description VARCHAR(500) NULL,
> parent_id NUMERIC(7) NULL
>REFERENCES app_components(id)
>
Why not just include examples of DATEDIFF and DATEADD functions?
For example:
CREATE FUNCTION datediff(timestamp, timestamp)
RETURNS integer AS '
BEGIN
RETURN $2 - $1;
END;
' LANGUAGE 'plpgsql';
And similarly with DATEADD.
You will increase the scope (and length) of your article, but only slightly
> "JB" == Josh Berkus <[EMAIL PROTECTED]> writes:
JB> Q. What about TIMESTAMP WITH TIME ZONE?
JB> A. An important topic, and datatype, that I don't want to get into here.
JB> See the PostgreSQL docs.
Those docs are lacking an explanation that there is no such thing in
PostgreSQL as a time
Folks,
Please review this for inaccuracies before I post it to pgsql-newbie and
the docs.
-Josh
FAQ: Working with Dates and Times in PostgreSQL
This FAQ is intended to answer the following questions:
Q: Where are the DATEADD() and DATEDIFF() functions in PostgreSQL?
Q: How do I tell the amou
Howdy,
> If the temp table doesn't fit in memory, we will have to put it in
> backing store somewhere, and a disk is the logical place, right? I
> don't see a huge advantage of putting it in memory. We could prevent
> WAL writes for temp tables. That would help.
Yes, if it won't fit in memory
14 matches
Mail list logo