Re: C++Builder table exist

From: Charl Roux <charl(dot)roux(at)hotmail(dot)com>
To: Postgre-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: C++Builder table exist
Date: 2013-03-18 10:25:05
Message-ID: DUB103-W6120959E8F0C849FB04BFA85E80@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Thanks. Case-folding was my problem.
Is there any way of getting PostgreSQL to work according to the SQL standard (The folding of
unquoted names to lower case in PostgreSQL is incompatible with the SQL
standard, which says that unquoted names should be folded to
upper case.), so there is no need for me to add quotes to all names?

> To: pgsql-general(at)postgresql(dot)org
> From: jasen(at)xnet(dot)co(dot)nz
> Subject: Re: [GENERAL] C++Builder table exist
> Date: Sat, 16 Mar 2013 06:16:33 +0000
>
> On 2013-03-13, Charl Roux <charl(dot)roux(at)hotmail(dot)com> wrote:
> > --_51d77859-0e03-4afa-bde6-853bee9c0a11_
> > Content-Type: text/plain; charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
>
> appologies for the formatting, gmane did something to your email that
> SLRN didn't like.
>
> > void __fastcall TfrmMain::FormCreate(TObject *Sender)
> > {
> > int errorCode;
> > TStringList *tableList = new TStringList;
> > frmDataModule->eyeConnection->GetTableNames(tableList);
> >
> > // create queryBackup table if does not exist
> > AnsiString SQL = "CREATE TABLE queryBackup( queryName VARCHAR(30) PRIMARY KEY ,query VARCHAR(10000))";
> > if( tableList->IndexOf("queryBackup") < 0 )
> > errorCode = frmDataModule->eyeConnection->ExecuteDirect(SQL);
> > }
>
> > ERROR: relation "querybackup" already exists.
>
> The problem is you're checking for queryBackup and then creating
> querybackup when it doesn't exist. (note: capitalisation)
>
> http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html
>
> This case-folding is one of the few places where postgres deliberately
> breaks the sql standard (AIUI standard wants case folded upwards).
>
> --
> ⚂⚃ 100% natural
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Charl Roux 2013-03-18 10:26:37 Re: C++Builder6 enum
Previous Message Craig Ringer 2013-03-18 07:10:11 Re: [HACKERS] Trust intermediate CA for client certificates