[dev] Ansel and Postgres db

Michael Rubinsky mrubinsk at horde.org
Fri Sep 12 14:51:22 UTC 2008


Quoting Jos W van der Woude <jos at veerkade.com>:

> Hi,
>
> Yesterday I installed Horde from cvs.
> I am using a postgres db.
>
> I am running into a problem with the ansel.sql script.
>
> The script uses type blob, which pgsql does not have. I have run  
> into  this before and changed type to bytea.
>
> This generates an error on the following line:
> CREATE INDEX ansel_faces_index_index_part_idx ON ansel_faces_index   
> (index_part (30));
>
> psql:ansel.sql:48: ERROR:  function index_part(integer) does not exist
> LINE 1: ..._faces_index_index_part_idx ON ansel_faces_index (index_part...
>                                                              ^
> HINT:  No function matches the given name and argument types. You   
> might need to add explicit type casts.
>
> So I added an explicit typecast, like ...
>
> CREATE INDEX ansel_faces_index_index_part_idx ON ansel_faces_index   
> (index_part (CAST (30 AS BYTEA)));
>
> psql:ansel.sql:48: ERROR:  cannot cast type integer to bytea
> LINE 1: ..._idx ON ansel_faces_index (index_part (CAST (30 AS BYTEA)));
>

The index_part (30) specifies a prefix length for the index. (Only the  
first 30 bytes of the indexed field are used to generate the index).  
 From my brief digging in the pgsql docs, it doesn't seem like that is  
supported in pgsql.

Unless anyone with pgsql-foo can point you in another direction, you  
will have to remove the (30) from the CREATE INDEX statement.

I'll create a pgsql specific sql script in the meantime.

Thanks for the report.

Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Time just hates me. That's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: PGP Digital Signature
URL: <http://lists.horde.org/archives/dev/attachments/20080912/e0ad5488/attachment.bin>


More information about the dev mailing list