Re: Substring Problem

From: <ludwig(at)kni-online(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Substring Problem
Date: 2008-05-13 13:56:38
Message-ID: 1833634.798471210686998360.JavaMail.servlet@pustefix156.kundenserver.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<span style="font-family: Verdana">Type casting is required since 8.3, try<br /><br />SELECT substring(date :: varchar from 1 for 7) AS stryearmonth, COUNT(id) AS countofnumber FROM (SELECT * from downloads ) AS foo GROUP BY stryearmonth ORDER BY stryearmonth ASC<br /><br />Bye...<br />Ludwig<span class="Apple-style-span" style="font-family: arial; font-size: 13px"><pre class="data" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 100%"><br /><br /><font class="Apple-style-span" color="#666666" face="verdana" size="3"><span class="Apple-style-span" style="font-size: 11px; white-space: normal">Hi there,</span></font></pre> <pre class="data"><font class="Apple-style-span" color="#666666" face="verdana" size="3"><span class="Apple-style-span" style="font-size:
11px; white-space: normal">it seems to work with 8.1, but not anymore with 8.3. What is wrong with this substring request? Or is it some installation issue? Thanks for any suggestion!</span></font></pre> <pre class="data" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 100%"><span class="Apple-style-span" style="color: #666666; font-family: verdana; font-size: 11px; white-space: normal">SELECT substring(date from 1 for 7) AS stryearmonth, COUNT(id) AS countofnumber FROM (SELECT * from downloads ) AS foo GROUP BY stryearmonth ORDER BY stryearmonth ASC</span></pre> <pre class="data" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 100%"><font class="Apple-style-span" color="#666666" face="verdana" size="3"><span
class="Apple-style-span" style="font-size: 11px; white-space: normal">It says:</span></font></pre> <pre class="data" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 100%"><font class="Apple-style-span" color="#666666" face="verdana" size="3"><span class="Apple-style-span" style="font-size: 11px; white-space: normal"><span class="Apple-style-span" style="color: #000000; font-family: arial; font-size: 13px"><pre class="data" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 100%">ERROR: function pg_catalog.substring(date, integer, integer) does not exist LINE 1: SELECT substring(date from 1 for 7) as stryearmonth, COUNT(i...</pre></span></span></font></pre></span></span>

Attachment Content-Type Size
unknown_filename text/html 2.3 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-05-13 14:01:52 Re: Problem returning strings with pgsql 8.3.x
Previous Message Sam Mason 2008-05-13 13:56:27 Re: Substring Problem