Thread: Escape Quotes

Escape Quotes

From
Keith Gray
Date:
When using apostrophies the PostgreSQL string seems to like 
an escape character as follows:

update client set code = 'O\'SHEA' where clientid = 2;


The ANSI-92 standard seems to suggest that this could/should 
be handled by 

<quote> ::= '
<quote symbol> ::= <quote><quote>
update client set code = 'O''SHEA' where clientid = 2;


Is it possible to get/configure PostgreSQL to handle <quote><quote>
as <quote> within a dleimited string?


Keith Gray


Re: Escape Quotes

From
Tom Lane
Date:
Keith Gray <keith@heart.com.au> writes:
> Is it possible to get/configure PostgreSQL to handle <quote><quote>
> as <quote> within a dleimited string?

We already do.

regression=# select 'O''SHEA';?column?
----------O'SHEA
(1 row)

        regards, tom lane


Re: Escape Quotes

From
Tom Lane
Date:
Keith Gray <keith@heart.com.au> writes:
> This may be a problem in "ipgsql" then??

I guess.  What is that, anyway?

> ...or is it different in update from select?

Nope, a literal is a literal.
        regards, tom lane


Re: Escape Quotes

From
Keith Gray
Date:
Tom Lane wrote:
> 
> Keith Gray <keith@heart.com.au> writes:
> > Is it possible to get/configure PostgreSQL to handle <quote><quote>
> > as <quote> within a dleimited string?
> 
> We already do.
> 
> regression=# select 'O''SHEA';
>  ?column?
> ----------
>  O'SHEA
> (1 row)
> 
>                         regards, tom lane
Sorry,

This may be a problem in "ipgsql" then??
...or is it different in update from select?

Keith


Re: Escape Quotes

From
Keith Gray
Date:
> > > Is it possible to get/configure PostgreSQL to handle <quote><quote>
> > > as <quote> within a delimited string?
> >
> > We already do.
> >
> 
> This may be a problem in "ipgsql" then??
> ...or is it different in update from select?


The problem is in ipqsql... 
it doesn't handle update, but does handle select.

Both work fine for psql (linux).


Keith.


Re: Re: Escape Quotes

From
Roberto Mello
Date:
On Fri, May 11, 2001 at 01:17:41PM +1000, Keith Gray wrote:
> 
> The problem is in ipqsql... 
What the heck is ipsql??
-Roberto
-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU -
http://www.brasileiro.net      http://www.sdl.usu.edu - Space Dynamics Lab, Developer    
 
In Borland you are never bored!


ipsql (was - Escape Quotes)

From
Keith Gray
Date:
Roberto Mello wrote:
>
>         What the heck is ipsql??
>
>         -Roberto

ipgsql

A Win32 client for interactive Postgres session


Keith                            README

Interactive PostgreSQL presents comfortable windows environment
to execute sql queries, edit tables data, view tables list and
structure, execute sql scripts, etc.

This application design on Delphi using PostgreSQL components,
which included in Winzeos Library:
http://www.zeos.dn.ua/download/winzeos-latest.zip

                       PARAMETERS

  Connect parameters for Interactive PostgreSQL stored in the
ipgsql.ini file in the same directory that ipgsql.exe
  You can change its manually or using File/Options dialog
  Parameters short description:

[Preferences]
  PgSQLPort=<N>        ; PostgreSQL port number (default 5432)
  IsAlive=1        ; Open alive queries  (default 1)
  IsCached=0        ; Use cached updates  (default 0)
  QueryAll=0        ; Query all records when open (default 0)
  AutoCommit=0        ; Auto commit updates (default 0)
  AutoRecovery=0    ; Auto rollback transaction when
            ; errors occured      (default 1)
  Login=<login>        ; PostgreSQL login    (no default)
  Host=<host name>    ; Host name           (no default)
  DataBase=<db name>    ; Database name       (no default)

                     EXTRA FEATURES

Program supports PostgreSQL Large Objects. In postgreSQL
database they represented as Oid fields which store LO handle.
In IPgSql these fields translate to Blob field.
You may store in Blob fields text, images or any binary data.
Open blob field editor by double click in grid or choose
View/Blob Editor menu item.

                       LICENCING

Zeos Library is distributed with the GPL licence and
costs you nothing.

                       DOWNLOADS

The latest version can be found on:
  http://www.zeos.dn.ua/download/ipgsql-latest.zip

                        KNOWN BUGS

1. When your sql query crash and AutoRecovery set to false
   end transaction manually.
   If AutoRecovery set to true after crash transaction
   is auto rollbacked.
2. IPgSql works only with PostgreSQL 6.5+

                          CREDITS

- Steve Wei for idea and support designing PostgreSQL components

Yours,
  Sergey Seroukhov, Chief Engineering of Capella Development Group.
  <voland@kita.dgtu.donetsk.ua>