Re: Are these supported??

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Vince Vielhaber <vev(at)chives(dot)michvhf(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Are these supported??
Date: 2016-08-17 14:44:40
Message-ID: CAMsr+YFcoA+m8tzxgahmvSs56ssiQBHj5GcokDr2J1j=Rbj=2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17 August 2016 at 11:33, Vince Vielhaber <vev(at)chives(dot)michvhf(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Igrishin 2016-08-17 15:00:51 Re: [GENERAL] C++ port of Postgres
Previous Message Oskari Saarenmaa 2016-08-17 14:41:05 Re: Use pread and pwrite instead of lseek + write and read