Re: Are these supported?? - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Are these supported??
Date
Msg-id CAMsr+YFcoA+m8tzxgahmvSs56ssiQBHj5GcokDr2J1j=Rbj=2Q@mail.gmail.com
Whole thread Raw
In response to Are these supported??  (Vince Vielhaber <vev@chives.michvhf.com>)
List pgsql-hackers


On 17 August 2016 at 11:33, Vince Vielhaber <vev@chives.michvhf.com> wrote:

I recently moved a mybb forum away from mysql to postgres.  Along the way I encountered a couple of things that either didn't seem to be supported or I'm just not doing it right. First, the server this is on is running version 8.4.22


8.4 is end-of-life, so it's time to move.

FYI, this isn't really the right place for these questions; pgsql-general or Stack Overflow is more appropriate for topics not relating to PostgreSQL code and design.

#1 Are joins supported in deletes?  The same join syntax works fine as
a select.

Yes, but the syntax is a bit different and you can't use aliases on the target table. You can also (unfortunately) only do inner joins.
 
#2 is extract supported in a select statement dealing with a table?  To explain this one, here is the error I get:

If 'dateline' is an integer, you'll have to turn it into a timestamp or date before you can extract the epoch.
 
# select extract(epoch from timestamp dateline::timestamp) from mybb_adminlog limit 1;

You can't use the typed-literal syntax 

TIMESTAMP 'something'

for a column reference, bind-parameter, etc. You can only use it for literals. Use a CAST or the PostgreSQL :: shorthand. Just remove the "timestamp" from "FROM timestamp".

Doesn't matter if I use epoch or day or anything else, they all fail with the same error.  And yes, dateline is a timestamp.

No, it isn't. The error message says so.

Please use pgsql-general or Stack Overflow.

--
 Craig Ringer                   http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Oskari Saarenmaa
Date:
Subject: Re: Use pread and pwrite instead of lseek + write and read
Next
From: Dmitry Igrishin
Date:
Subject: Re: [GENERAL] C++ port of Postgres